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

Update markdown-in-html extra to handle markdown on same line as HTML (#546) #547

Merged
merged 4 commits into from Dec 10, 2023

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!

@nicholasserra nicholasserra merged commit f817f0b into trentm:master Dec 10, 2023
18 checks passed
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