[ignoreWhitespace] are newlines equal to spaces?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- css, javascript
- Domain
- testing
Research direction
Start with the code referenced at pull request #66, especially line 39 on the right, and reproduce the two HTML examples from the issue. Check how newline and space text nodes are compared; done means the examples are treated as equivalent without changing whitespace that CSS preserves.
Written by the indexing model from the issue text.
Description
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 not pre, pre-wrap, or pre-line, segment breaks (i.e. newlines) are usually converted to a space U+0020.
- Dominant language
- JavaScript
- Stars
- 217
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bem/html-differ
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
bem/html-differ#175 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
bem/html-differ#173 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
bem/html-differ#171 · 1 comment · 3 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
bem/html-differ#170 · 2 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
bem/html-differ#169 · 1 comment ·
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mksglu/context-mode#1200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
neondatabase/website#5944 ·
-
module: core
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
bigbluebutton/bigbluebutton#25849 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jaegertracing/jaeger-ui#4506 ·