mistune: Nested HTML inside block_html is escaped when escape=False, parse_block_html=True
Normally 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>
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 17 (7 by maintainers)
Commits related to this issue
- Fix html attribute regex. Close #99 — committed to lepture/mistune by lepture 8 years ago
@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.