Skip to content

HTML block handling nested in indented blocks doesn't work properly #1096

Open
@facelessuser

Description

@facelessuser

The following example shows that raw HTML that has empty newlines in the content are not handled properly, and are instead treated as incomplete HTML fragments.

import markdown

print(f"Markdown: {markdown.__version__}")

print("\n------ Results ------\n")

content = r'''
!!! note "Admonition"
    <div>
    Some text

    Some more text
    </div>
'''

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

Output

Markdown: 3.3.3

------ Results ------

<div class="admonition note">
<p class="admonition-title">Admonition</p>
<p><div>
Some text</p>
<p>Some more text
</div></p>
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report.confirmedConfirmed bug report or approved feature request.someday-maybeApproved low priority request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions