Closed nokome closed 4 days ago
Welcome @nokome! 👋 It is supported, the syntax is different from what you are trying. It needs to have a descending number of backticks. Larger on the outside smaller on the inside.
````md
First code block
```python
# Nested code block
Thanks @ChristianMurphy for the quick response! That syntax is a little more awkward to implement for my use case but great to know it is supported.
I assume your use case is wanting to use markdown. The markdown crate, follows the markdown standard https://commonmark.org/ Descending number of backticks is how nesting code works in markdown.
If your use case includes making yet another markdown flavor, see https://github.com/wooorm/markdown-rs/issues/32 for work toward plugins and syntax extensions.
Sticking with standards (in this case, CommonMark/GFM), means that your markdown files will work everywhere. Here on GH too. And in the syntax highlighter in your editor. Going with a non-standard format would mean the content is not so portable!
First, thanks for this crate! (and more generally all the awesome work you do to help developers parse Markdown! 🙌🏽 )
In my usage, I need to handle nested fenced code blocks, but as the follow test shows, this is currently not supported. If you think this would be a good thing to support let me know and I can have a go at a PR.