Skip to content

Stop newlines from generating invalid html#709

Open
seangoedecke wants to merge 1 commit into
vmg:masterfrom
seangoedecke:sgoedecke/patch-invalid-html
Open

Stop newlines from generating invalid html#709
seangoedecke wants to merge 1 commit into
vmg:masterfrom
seangoedecke:sgoedecke/patch-invalid-html

Conversation

@seangoedecke

Copy link
Copy Markdown

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
Copy Markdown
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.

1 participant