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
I'd like to use html-differ to write a test system for marked, where generated html output is to be compared to pre-written html code, to determine if the two are equivalent, so I would like to ignore whitespace differences, when they are not meaningful (as in <p> tags), but I noticed that newlines are treated differently than spaces:
<p>A link. Not anymore.</p>
is not considered equal to
<p>A link.
Not anymore.</p>
when, IMO, they should be.
I've tracked this to be probably determined by this line of code (line 39 on the right).
I'm aware this issue is related to CSS, and not HTML itself. According to CSS specification, when the white-space property is notpre, pre-wrap, or pre-line, segment breaks (i.e. newlines) are usually converted to a space U+0020.
The text was updated successfully, but these errors were encountered:
I think you should replace them with a space to adhere to the segment break transformation rules for non-prewhite-space CSS styles. Multiple adjacent spaces are then collapsed to a single one in the next step, so the following two paragraphs will be equivalent, instead:
I'd like to use html-differ to write a test system for marked, where generated html output is to be compared to pre-written html code, to determine if the two are equivalent, so I would like to ignore whitespace differences, when they are not meaningful (as in
<p>
tags), but I noticed that newlines are treated differently than spaces:is not considered equal to
when, IMO, they should be.
I've tracked this to be probably determined by this line of code (line 39 on the right).
I'm aware this issue is related to CSS, and not HTML itself. According to CSS specification, when the
white-space
property is notpre
,pre-wrap
, orpre-line
, segment breaks (i.e. newlines) are usually converted to a spaceU+0020
.The text was updated successfully, but these errors were encountered: