Nested HTML inside block_html is escaped when escape=False, parse_block_html=True
See original GitHub issueNormally with escape=False
, nested HTML block is corectly not escaped:
>>> print markdown('<div id="special-part"><div class="subsection">text</div></div>', escape=False)
<div id="special-part"><div class="subsection">text</div></div>
But when I add parse_block_html=True
, only out-most element is not escaped and the rest is escaped:
>>> print markdown('<div id="special-part"><div class="subsection">text</div></div>', escape=False, parse_block_html=True)
<div id="special-part"><div class="subsection">text</div></div>
Issue Analytics
- State:
- Created 8 years ago
- Comments:17 (7 by maintainers)
Top Results From Across the Web
ruby on rails - nested content_tags escape inner html.. why?
It happens because in Rails 3 the SafeBuffer class was introduced which wraps the String class and overrides the default escaping that would ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@teoguso @lepture It actually does, even if it’s a bad practice. So, right now it is not following the HTML5 spec:
source(emphasis mine)
The same restrictions & allowances (more or less) also apply to single quoted and double quoted values.
NB: There is this SO post on why it might be bad practice.
Fixed in 0.8.4