mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Some content inside fenced codeblocks is being transformed #762
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 @mavnn on GitHub (Nov 13, 2025).
In the following markdown, the bullet points of the fenced codeblock are being transformed into html unordered list elements rather than preserved as plain text. Each
<li>element within the list is then also being wrapped in it's own<code>element for extra formatting strangeness.Input
Output:
Strangely, it is possible to work around this issue by putting inline code markers around the punctuation within the code block, although this then creates nested html
<code>elements. This suggests that there is a further bug there (the inline markers should not be being processed within the fenced block either):Input 2:
Output 2:
@xoofx commented on GitHub (Nov 13, 2025):
Hm, are you sure that this is the exact setup you have? Cannot reproduce it here
Are you using particular extensions maybe? What is the version you are using?
@mavnn commented on GitHub (Nov 13, 2025):
Thanks for the quick response.
I'm using version 0.43, according to
Markdig.Markdown.Version.The workflow I'm using is:
System.IO.ReadAllTextAsyncMarkdig.Markdown.ToHtmlwith the string from aboveI'm not using any extensions, so I'm not quite sure what would be the next step to help with the debugging.
@xoofx commented on GitHub (Nov 13, 2025):
Could you post the exact Program.cs you are using?
@mavnn commented on GitHub (Nov 13, 2025):
Sort of! I'll post this here for now, let me see if I can create a reproduction that isn't in the web server context.
@mavnn commented on GitHub (Nov 13, 2025):
Actually - ignore me completely: on this page I was feeding the output of
Markdown.ToHtmlto...Markdown.ToHtmlbefore returning it from the handler.Apologies for the noise, and thank you for the courteous response!