commonmark / commonmark/commonmark.js
Leading and trailing non-`whitespace` `Unicode whitespace` is stripped from paragraphs
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 231
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 3
Description
The CommonMark dingus implementation currently strips non-whitespace Unicode whitespace from
the start and end of paragraphs. The CommonMark specification and the cmark implementation seem to indicate that these characters should not be stripped.
Each "space" character in this example is U+1680, OGHAM SPACE MARK, chosen from the list of Unicode whitespace characters that are not in the list of whitespace characters.
Note that the leading and trailing U+1680 characters have been trimmed from the final result.
From CommonMark 0.28, section 4.8:
The paragraph’s raw content is formed by concatenating the lines and removing initial and final [whitespace].
By comparison, in cmark 0.28.3:
Input:
o o
o o
Output:
<p> o o
o o </p>
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
Start by reproducing the linked U+1680 example in the CommonMark dingus implementation and compare its output with the CommonMark specification and cmark 0.28.3. Locate the paragraph whitespace-trimming logic and any related tests. Done means leading and trailing U+1680 characters remain in the rendered paragraph, while ordinary whitespace handling remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100