-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code block not recognized as one if there is trailing space on the closing fence #135
Comments
For the record, this parser implements CommonMark Spec, with only some GFM extensions (that are optional but enabled by default). I would prefer to stay strict on this (and similar "softenings" of restrictions that make parsing easier). |
But CommonMark also specifies that whitespace after closing fences are to be ignored, so this should be fixed (here). PR welcome! |
I can confirm that this also happens when the closing fence is followed immediately by EOF. That's an easier scenario to catch than trailing whitespace, so I might open a PR for that case specifically. |
If that's easy, a fix there would be awesome, because I think that's probably a more common scenario than trailing whitespace, though obviously both would be nice to have |
I would think both should be a fairly easy fix, no? I might be missing something, but it looks like we could just check for end of file or space in addition to
|
Describe the bug
Ref helix-editor/helix#9678
Code example
Replace the single quotes with backticks and
int i = 0
will be highlighted as C.Expected behavior
According to https://github.github.com/gfm/#fenced-code-blocks, trailing whitespace are ignored on the closing code fence.
Actual behavior
Closing fence is not recognized.
The text was updated successfully, but these errors were encountered: