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

Stop newlines from generating invalid html #709

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seangoedecke
Copy link

Here's my crack at fixing #703

Previously, adding \n in the middle of html tags would cause the markdown generator to wrap some html fragment in <p> tags, often causing the generation of invalid html like this:

<div><p></div></p>

This commit adds a check in the paragraph generation code to treat the content as plain html if it begins with a closing html tag.

I'm not thrilled about how I'm detecting closing html tags and differentiating them from angle-bracket relative links like [a](</link>) - if there's machinery elsewhere in the codebase for doing that that I missed, I'm very happy to refactor to use that.

Previously, adding `\n` in the middle of html tags would cause the
markdown generator to wrap some html fragment in `<p>` tags, often
causing the generation of invalid html like this:

`<div><p></div></p>`

This commit adds a check in the paragraph generation code to treat the
content as plain html if it begins with a closing html tag.
@seangoedecke
Copy link
Author

This change also fixes #652, FWIW.

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.

None yet

1 participant