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 emphasises aren't processed #347

Open
dreamscached opened this issue Jun 8, 2023 · 0 comments
Open

Nested emphasises aren't processed #347

dreamscached opened this issue Jun 8, 2023 · 0 comments
Labels

Comments

@dreamscached
Copy link

dreamscached commented Jun 8, 2023

Unsure if this was already reported or is being worked on; please correct me if so.

The problem is the following:

>>> import mistune
>>> md = mistune.create_markdown()
>>> md('***foo**bar*')
'<p>***foo**bar*</p>\n' 

As you can see, an attempt to create nested emphasis leads to both being ignored; however, when using triple asterisks, it works as expected:

>>> md('***foobar***')
'<p><em><strong>foobar</strong></em></p>\n'

Mistune version is 3.0.0

I would first suppose it's my fault with custom renderer, but here I'm trying it on a fresh virtual environment with no plugins and built-in HTML renderer. I would also think it's probably maybe something nonstandard, but nearly every service that uses Markdown seems to work fine with this case.

P.S. Briefly looking into how it's made, maybe it's worth splitting logic and implement rather not by usage of special *** token but rather by recognizing it as * and ** located one inside the other and vice versa?

@lepture lepture added the bug label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants