EnableTrackTrivia() is not generating valid HTML
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.3k
- Forks
- 510
- Avg merge
- 8d 5h
- Merged PRs (30d)
- 5
Description
Followup of #561, I have added a test to check that when enabling EnableTrackTrivia() the generated HTML is still the same, but this test is failing on 80+ CommonMark tests because the representation to HTML expect a destructive output, not a conservative. Also the output is also semantically different, enough to be invalid. For example EnableTrackTrivia() might not generate proper ParagraphBlocks <p> but have multiple literals with lines in them or spaces in place that are not relevant for HTML.
Not sure what to do. The code for parsing trivia has complicated the code enough that it might be too painful to fix it for HTML and we should then document that EnableTrackTrivia() can be only used for Markdown manipulation but not for rendering to HTML.
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 with the EnableTrackTrivia() test in src/Markdig.Tests/TestParser.cs around line 122 and reproduce the failures across the CommonMark tests. Compare the generated HTML for paragraph and literal handling, focusing on the semantically invalid output described here. Done means either restoring valid, equivalent HTML rendering or documenting that EnableTrackTrivia() is limited to Markdown manipulation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100