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
HTML tags in blockquotes are not stripped #6
Comments
I think the problem is that blockquotes contain nested nodes. I fixed the issue here, but I feel like there's a cleaner way to do this, so I didn't want to make a PR yet: https://github.com/mntn-xyz/gmnhg/tree/blockquote To fix it, I rendered children recursively, and if it was an HTMLBlock or HTMLSpan then I just rendered the node as a plain leaf, replacing the text with the Markdown content. There's definitely a better way to do this, I was just messing around to see if it could be fixed... |
@mntn-xyz this looks like it could be possibly unified with the container branch of If anything, this is probably good: it makes up for possible future fixes landing in gomarkdown. |
Makes sense to me, I'll put together a patch sometime this week. |
This makes the renderer print the content of informational HTML tags while stripping the tags themselves. Tags like script, iframe, style, etc, which are unlikely to ever hold presentable content, are exempt from this, and their content is skipped from rendering as well as the tags themselves. <br>, a hard-break tag, is supported as a Markdown hard-break replacement (the two spaces before newline). This also adds tests for this behavior inside general_text.md. Fixes #6, a longstanding issue with inline HTML in blockquotes.
Initially discovered in #5.
Despite
(Renderer).paragraph()
utilizing (mostly) the same logic as(Renderer).blockquote()
, raw HTML is stripped from text paragraphs, but not from blockquotes. Appears to be a gomarkdown issue.The text was updated successfully, but these errors were encountered: