Skip to content

Conversation

@Crozzers
Copy link
Contributor

@Crozzers Crozzers commented Dec 9, 2023

This PR closes #546 by enabling the markdown-in-html extra to parse snippets where the markdown is on the same line as the HTML block. For example:

<p markdown="1">**text**</p>

The fix works by detecting whether the number of matched lines is less than 3 (meaning opening tag, closing tag and content aren't all on separate lines). The first line is then split after the opening tag, and the last line is split before the closing tag.

['<p markdown="1">**text**</p>']          # initial list of lines
['<p markdown="1">', '**text**</p>']      # after first line is split
['<p markdown="1">', '**text**', '</p>']  # final state

This allows the extra to continue as normal

@nicholasserra
Copy link
Collaborator

Thanks!

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 this pull request may close these issues.

Markdown Syntax Not Converted Within HTML Tags in markdown2

2 participants