mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Parsing triple backticks with langage name #358
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 @NikRimington on GitHub (Apr 4, 2020).
Hi,
This is more of a help question than an issue, however markdig indicates that it works to the CommonMark standard which, as I understand it, is capable of parsing code in the format of:

However when I parse it, this is the output:

I'm trying to parse my markdown code so I can use something like Prism for front end syntax higlighting, however it's not parsing the block at all when I add the language name.
This is how I'm parsing it:
Where inter is a string value passed into an object, e.g.
public object ParseValue(object inter)(the method is part of an interface hence the object return type and input type however it cannot be changed.Any ideas why it's not parsing the codeblock would be greatly appreciated.
Many thanks,
Nik
@AdmiringWorm commented on GitHub (Apr 4, 2020):
Seems to be reproducible on babelmark as well:
https://babelmark.github.io/?text=%23+This+is+a+header%0A%23%23+This+is+a+level+2+heading%0A%0A%3Cp+class%3D%22text-xl%22%3E%0AThis+is+a+normal+paragraph%0A%3C%2Fp%3E%0A%60%60%60css%0AThis+is+code+in+three+%60%27s%0A%60%60%60
However, it works as expected when there is an empty line between the
</p>and```csshttps://babelmark.github.io/?text=%23+This+is+a+header%0A%23%23+This+is+a+level+2+heading%0A%0A%3Cp+class%3D%22text-xl%22%3E%0AThis+is+a+normal+paragraph%0A%3C%2Fp%3E%0A%0A%60%60%60css%0AThis+is+code+in+three+%60%27s%0A%60%60%60
I don't know if this is intended or a bug in markdig though.
@NikRimington commented on GitHub (Apr 4, 2020):
Ohh, I can work with that as a work around if it is a bug. I'm fairly new to markdown in general (at least the nuances of it at least) so if it's meant to have the extra space that's no problem :) Thanks you!
@xoofx commented on GitHub (Apr 4, 2020):
It's not a bug, you need an empty line after the closing html tag. Other CommonMark have similar behavior.