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

Process inline tags as HTML blocks when they span multiple lines (#571) #572

Merged
merged 2 commits into from Mar 24, 2024

Conversation

Crozzers
Copy link
Contributor

This PR closes #571.

Sometimes, inline tags (such as <a>) are written over multiple lines for readability, which makes them look alot like block elements. When spread out over multiple lines, the opening and closing tags would be detected as paragraphs and wrapped in <p> tags, which is invalid.

This PR avoids this by hashing these block-like spans to protect them from _form_paragraphs. The contents of these are run though _run_span_gamut in case there's any markdown in there. Since inline tags shouldn't contain block tags, we don't need to worry about processing any blocks.

The list of span tags was taken from here.

This fixes an issue where inline tags were being wrapped in paragraph tags
@nicholasserra
Copy link
Collaborator

LGTM thanks!

@nicholasserra nicholasserra merged commit 4722442 into trentm:master Mar 24, 2024
18 checks passed
@dannykennedy
Copy link

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.

Random <p> tags inserted when using HTML in markdown
3 participants