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

Match closing fence char and length in fenced code blocks #681

Merged
merged 2 commits into from
Jul 1, 2021

Conversation

martincizek
Copy link
Contributor

is_codefence() now allows fence-pair matching to comply with https://spec.commonmark.org/0.29/#fenced-code-block

closing code fence of the same type as the code block began with (backticks or tildes), and with at least as many backticks or tildes as the opening code fence

So the following now works (as it does in GitHub, otherwise it would be difficult to type this :-))

````
This is some code containing a fence string
```
protected by extending the enclosing fence
````

~~~
This is some code containing a fence string
```
protected by using the other fence type
~~~

Fixes #208.

@mattr-
Copy link
Collaborator

mattr- commented Jul 1, 2021

Apologies for taking so long to review this and merge it in. Thank you for contributing this feature to Redcarpet! ❤️

@mattr- mattr- merged commit 03b664d into vmg:master Jul 1, 2021
@djuber
Copy link

djuber commented Jul 9, 2021

@mattr- thanks for merging this! Is there a gem version release expected soon that incorporates this? Would you like me to start a PR for that?

@mattr-
Copy link
Collaborator

mattr- commented Aug 5, 2021

We'll handle the gem version bump and release from here. No ETA on when that might be though. If you can use master for the time being, I recommend doing that.

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.

Unable to escape code fences
3 participants