mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
HTML comments break things #737
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 @alex-jitbit on GitHub (May 6, 2025).
@xoofx commented on GitHub (May 6, 2025):
This is expected as per the specs https://spec.commonmark.org/0.31.2/#example-155
HTML requires a blank line to separate from markdown rendering, example here
If the HTML is at the beginning of a line, it is considered a HTML block, not a HTML inline.
That would be different with the following
hello world <!--comment--> text *italic*here@alex-jitbit commented on GitHub (May 6, 2025):
Understood. I will just tell all JS-based frontend packages to produce strictly valid code, problem solved! 😂
OK, pardon my sarcasm. But your "stick to the specs or get out" approach makes the library very hard to use with UGC (user-generated content). I will have to write a pre-processor to make my code "mardig friendly" before processing.
P.S. Minutes after posting this issue I bumped into this #728 😂
@xoofx commented on GitHub (May 6, 2025):
CommonMark was created specifically to address these types of inconsistencies, which made it nearly impossible to achieve reliable rendering across different Markdown engines. Markdig adheres to the CommonMark specification to avoid ambiguity, endless debates, and subjective interpretations. If the input doesn't conform to CommonMark, it's outside the scope of what Markdig is designed to handle.
That said, I find your sarcasm a bit out of place - especially considering the significant time and effort I (and others) have dedicated over months of full-time work to provide this open-source library for free. 😒
@alex-jitbit commented on GitHub (May 6, 2025):
Yes. Just like every standard ever. HTML, MIME, IMAP, etc. They all aim to "address issues", until they face the real world.
Imagine if email software was like "hey, I won't connect to Office365 mail server because MS protocol does not follow the MIME spec" (true story by the way)
I'm an OSS developer myself. I know how it feels.
Anyways. Thanks. Your point has been noted thank you.
@xoofx commented on GitHub (May 6, 2025):
Oh, right, I don't live in the real world. You do. Thank you for this reminder.
Oh, right, I'm not running a business, this is OSS. That explains.
Really? With that kind of comments, you just got banned from communication with me. Good luck in OSS with that kind of attitude.