G
YouTube TikTok Games
Skip to content

Bug related to Admontion and List Interaction  #1004

Closed

Description

@facelessuser

Source:

import markdown

md = """
- List

    !!! note "Admontion"

        - Paragraph

            Paragraph
"""

print(markdown.markdown(md, extensions=['admonition']))

Output:

<ul>
<li>
<p>List</p>
<div class="admonition note">
<p class="admonition-title">Admontion</p>
<ul>
<li>Paragraph</li>
</ul>
<pre><code>Paragraph
</code></pre>
</div>
</li>
</ul>

Somehow, things get out of sync. Second paragraph under admonition should not be transformed into code.

Activity

  1. facelessuser commented on Jul 24, 2020

    @facelessuser
    CollaboratorAuthor

    I think I may have figured this out. It is was more complicated than I would have liked. I think list parsing is another sore spot for me in the parser, but it looks like the admonition extension can solve this with a little more intelligence.

    I'll need time to run it through tests and such though.

  2. facelessuser commented on Jul 24, 2020

    @facelessuser
    CollaboratorAuthor

    This likely impacts definition lists too.

  3. self-assigned this
    on Jul 24, 2020
  4. added a commit that references this issue on Jul 26, 2020
    5941ee6
  5. added a commit that references this issue on Jul 26, 2020
    611cf6d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugBug report.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions