commonmark / commonmark/commonmark.js
Source information missing from parsed nodes
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 231
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 3
Description
I'm making a renderer that will modify a tree in-place, but can roundtrip MarkDown back to the same MarkDown (or mostly the same).
There is some information missing from the parsed nodes that would be useful reconstructing the original document. In particular:
- Whether a
code_blockwas originally fenced or indented. - What symbol was used for emphasis, either
*or_.
Can these be added to the parse nodes?
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
Begin by locating the parser code that creates parsed nodes and the handling for code_block and emphasis. Check how node attributes are represented and how existing parser tests cover these constructs. Done means nodes preserve fenced-versus-indented origin and the * versus _ emphasis marker, with tests demonstrating both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100