mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-09 13:56:56 +00:00
EnableTrackTrivia() is not generating valid HTML #512
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xoofx on GitHub (Mar 10, 2022).
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 exampleEnableTrackTrivia()might not generate proper ParagraphBlocks<p>but have multiple literals with lines in them or spaces in place that are not relevant for HTML.94581d9655/src/Markdig.Tests/TestParser.cs (L122)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.