Skip to content
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

nested html links are broken with parse_block_html #137

jvanasco opened this issue Sep 6, 2017 · 3 comments


Copy link

@jvanasco jvanasco commented Sep 6, 2017

this is a variant of #81

example_in = '<div><a href=""></a></div>'
mistune.markdown(example_in, escape=False, parse_block_html=True)

will generate:

<div><a href="<a href=""&gt;">"&gt;</a></a></div>

if escape is toggled to True, it is also broken:

'<div><a href="<a href=""&gt;"&gt;"&gt;;/a&gt;&lt;/a&gt;&lt;/div>


This comment has been minimized.

Copy link

@lepture lepture commented Oct 12, 2017

Current implementation of parse_block_html=True is not working well.


This comment has been minimized.

Copy link

@frostming frostming commented Nov 29, 2017

After a deep look into the source code, the root cause is when parsing the html body with inline, it uses a subset of default rules which doesn't contain inline_html rule. Then the body with urls will be captured by url rule.

I am glad to send a pull request


This comment has been minimized.

Copy link

@lepture lepture commented Nov 29, 2017

@frostming yes, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.