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

Emphasis parsing failure around parenthesis #846

Open
Yaossg opened this issue Feb 21, 2024 · 1 comment
Open

Emphasis parsing failure around parenthesis #846

Yaossg opened this issue Feb 21, 2024 · 1 comment

Comments

@Yaossg
Copy link

Yaossg commented Feb 21, 2024

This bug has existed for a long time. It could be triggered as long as asterisks touch at least one side of parentheses, regardless of English or Chinese ones. Adding a space in-between could resolve it. .

In fact, there are many other cases where emphasis failed. But this one is quite typical and annoying among all.

Source:

**(Test)**WithoutSpace

**(测试)**不加空格

Expected Result: (from pandoc)

<p><strong>(Test)</strong>WithoutSpace</p>
<p><strong>(测试)</strong>不加空格</p>

Actual Result:

<p>**(Test)**WithoutSpace</p>
<p>**(测试)**不加空格</p>
@ehuss
Copy link
Contributor

ehuss commented Feb 21, 2024

Thanks for the report! I believe this is expected behavior, as pulldown-cmark closely follows CommonMark. In one of these cases, I believe it is the right-flanking delimiter rule which prevents it.

Unfortunately CommonMark does not handle scripts that don't have the same spacing characteristics as many western languages. I see several other people bring up this exact same issue on the forum, but unfortunately from the replies it doesn't look like it is likely to change in the foreseeable future. If pulldown-cmark were to support it, I think it would have to be as an extension.

In the meantime, you'll probably need to add or remove spaces to get it to work, or use HTML tags instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants