Skip to content

Fenced directives after a list are rendered as a codeblock when custom markers are set #412

@KeithTsao

Description

@KeithTsao

The test code is as follows.

from mistune import create_markdown
from mistune.directives import FencedDirective, Admonition

md = create_markdown(plugins=[FencedDirective([Admonition(),], '`')])

html = md('''
- a
- b

```{note} 
a note
```
''')

print(html)

The program will mistake the fenced directives into a codeblock and print as

<ul>
<li>a</li>
<li>b</li>
</ul>
<pre><code class="language-{note}">a note
</code></pre>

The code is tested under windows 11 with python 3.11 and mistune 3.1.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions