You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve space normalization when pretty-printing #1798
When pretty-printing, newlines and trailing spaces could be better handled.
Two cases as examples:
<div>
·Text
</div>
(with · representing a space), is currently emitted as:
<div>
··Text·
</div>
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.
Activity
Trim leading and trailing spaces in blocks when appropriate