Skip to content
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

Fix code span wrongly identified as code block #205

Closed

Conversation

step-
Copy link
Contributor

@step- step- commented Jan 8, 2024

Close #201.

What happens in #201 is that MD4C identifies the first "```" as the start of a fenced code block.

Threfore it renders "aaa" and " ```" as code block lines, then it
automatically closes the fenced code block at EOF.

DETAILS

Commonmark spec 0.30 about fenced code blocks.

A fenced code block begins with a code fence, preceded by up to three spaces of indentation.[1]
A fenced code block may interrupt a paragraph, and does not require a blank line either before or after.[2]

Close mity#201.

What happens in mity#201 is that MD4C identifies the first "```" as the
start of a fenced code block.

Threfore it renders "aaa" and "    ```" as code block lines, then it
automatically closes the fenced code block at EOF.

DETAILS

Commonmark spec 0.30 about fenced code blocks.

A fenced code block begins with a code fence, preceded by up to three
spaces of indentation.[1]
A fenced code block may interrupt a paragraph, and does not require a
blank line either before or after.[2]

- [1] https://github.com/commonmark/commonmark-spec/blob/d5706b9553d4665ca730524323d484880440186c/spec.txt#L1940
- [2] https://github.com/commonmark/commonmark-spec/blob/d5706b9553d4665ca730524323d484880440186c/spec.txt#L1969
@mity
Copy link
Owner

mity commented Jan 8, 2024

Race condition :-) Fixed few minutes ago myself.

@mity mity closed this Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code span wrongly identified as code block
2 participants