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

Multiple fenced code blocks break them #580

Closed
IncandescentChrysalis opened this issue May 27, 2024 · 0 comments · Fixed by #582
Closed

Multiple fenced code blocks break them #580

IncandescentChrysalis opened this issue May 27, 2024 · 0 comments · Fixed by #582

Comments

@IncandescentChrysalis
Copy link

IncandescentChrysalis commented May 27, 2024

Describe the bug

Multiple fenced code blocks seem to pollute each other

To Reproduce

* List 1
  ```
  code 1

  code 2
  ```

```
code 3
```

Observed behavior

<ul>
<li>List 1
<pre><code>code 1

code 2</li>
</ul>

</code></pre>

<pre><code>code 3

<p></code></pre></p>

Expected behavior

<ul>
<li>List 1
<pre><code>code 1

code 2
</code></pre></li>
</ul>
<pre><code>code 3</code></pre>

Debug info

Version of library being used:

  • markdown2==2.4.13

Extras used:

  • fenced-code-blocks

Additional context

Broken for nested lists too.

The following Markdown code:

* List 1
    * List 2
      ```
      code 1

      code 2
      ```

```
code 3
```

yields:

<ul>
<li>List 1
<ul>
<li>List 2
<pre><code>code 1

code 2</li>
</ul></li>
</ul>

</code></pre>

<pre><code>code 3

<p></code></pre></p>

instead of:

<li>List 1
<ul>
<li>List 2
<pre><code>code 1

code 2
</code></pre></li>
</ul></li>
</ul>
<pre><code>code 3</code></pre>

All Markdown code cross-tested with the markdown-it demo.

Crozzers added a commit to Crozzers/python-markdown2 that referenced this issue May 27, 2024
nicholasserra added a commit that referenced this issue May 27, 2024
Fix fenced code blocks breaking lists (#580)
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 a pull request may close this issue.

1 participant