-
Notifications
You must be signed in to change notification settings - Fork 119
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 output without inline HTML blocks #74
Comments
One downside of the current method is that any line or lines that count as an HTMLDiv do not have a wrapping set of <p> tags. : input
<div>hello</div>
: expected
<p><div>hello</div></p>
: current
<div>hello</div> This doesn't happen to tokens counted as span. I'm not sure what the best way to implement wrapping <p> on HTMLBlocks is. (1) is the quick and simple appending/prepending <p> manually on the Finally, the current tests feel a little brittle. Any suggestions on improvements would be really appreciated. |
Or, as an alternative and hopefully working solution, what about simply disabling parsing of HTML elements? I. e. change the following line in your
... to:
The existing What do you think? |
Markdown that doesn't accept inline HTML is a common use-case for comments and as a quick way to sanitize input. A contrib renderer that renders HTML while escaping inline HTML tags would be convenient to have.
I'm trying to implement this myself--unless my initial tests are wrong, it seems I can simply inherit from HTMLRenderer and override the
render_html_block
andrender_html_span
methods--and I'll have a PR up soonish.The text was updated successfully, but these errors were encountered: