commonmark / commonmark/commonmark.js
White space handling looks inconsistent between HTML block element vs HTML inline element
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 231
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 3
Description
Hi. I'm curious about why white space preservation / removal differs between <div> and <a> in following case:
Input:
<div class="abc
d e f">text</dev>
<a class="abc
d e f">text</a>
Output:
<div class="abc
d e f">text</dev>
<p><a class="abc
d e f">text</a></p>
I've read https://spec.commonmark.org/0.31.2/ but it's not obvious whether it's a bug or intentional.
I came from https://github.com/orgs/micromark/discussions/211.
Contributor guide
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.
Research direction
Reproduce the linked CommonMark Dingus example and compare the block-element and inline-element output with the referenced CommonMark 0.31.2 specification. Determine whether the difference is intentional or a parser bug; done means the expected behavior is established and, if needed, a concrete change and regression test are identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100