Skip to content

Additional paragraph when using Markdown in raw HTML #595

Description

@jannschu

First thank you for this implementation! 👍

I provide a minimal working example of some unexpected behavior I encountered:

import markdown
md = markdown.Markdown(extensions=['extra'])
html = md.convert("<div markdown><p>Hello _World!_</p></div>")
print(html)

The output was

<div>
<p><p>Hello <em>World!</em></p></p>
</div>

But I expected

<div>
<p>Hello <em>World!</em></p>
</div>

My workaround is to use two line breaks (edit)

html = md.convert("<div markdown>\n\n<p>Hello _World!_</p></div>")

does not include the additional paragraph, but the Markdown is not replaced.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report.coreRelated to the core parser code.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