When pretty-printing, newlines and trailing spaces could be better handled.
Two cases as examples:
(with · representing a space), is currently emitted as:
As the textnode value is "·Text\n", and then when pre-printing, that gets indented (now two leading spaces but should only be one if the indent level is set to one); and then the trailing newline gets normalized to a space.
Similarly,
<div>
<p>One
<p>Two
</div>
Gets emitted as
<div>
<p>One·</p>
<p>Two·</p>
</div>
As the trailing newline in the textnode is normalized to a space, when it could actually be trimmed (as it is the last text in a block tag and therefore not important whitespace for text flow).
This would fix the underlying issue found in #1663.
When pretty-printing, newlines and trailing spaces could be better handled.
Two cases as examples:
(with
·representing a space), is currently emitted as:As the textnode value is "·Text\n", and then when pre-printing, that gets indented (now two leading spaces but should only be one if the indent level is set to one); and then the trailing newline gets normalized to a space.
Similarly,
Gets emitted as
As the trailing newline in the textnode is normalized to a space, when it could actually be trimmed (as it is the last text in a block tag and therefore not important whitespace for text flow).
This would fix the underlying issue found in #1663.