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 nodes not working with surrounded Chinese chars and Chinese punctuations #2580

Closed
4 tasks done
weareoutman opened this issue Jan 17, 2025 · 6 comments
Closed
4 tasks done
Labels
🤞 phase/open Post is being triaged manually

Comments

@weareoutman
Copy link

weareoutman commented Jan 17, 2025

Initial checklist

Affected package

@mdx-js/[email protected]

Steps to reproduce

Go to the official playground and paste:

匹配*“abc”*字符

It generates:

{
  "type": "root",
  "children": [
    {
      "type": "paragraph",
      "children": [
        {
          "type": "text",
          "value": "匹配*“abc”*字符"
        }
      ]
    }
  ]
}

Actual behavior

With surrounded Chinese chars and Chinese punctuations, no emphasis nodes been generated.

Have to add spaces around the * to make it work.

Expected behavior

Expect to generate an emphasis node in the document.

Runtime

No response

Package manager

No response

Operating system

No response

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jan 17, 2025
@ChristianMurphy
Copy link
Member

Duplicate of remarkjs/remark#1107

Copy link

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

@ChristianMurphy
Copy link
Member

This is how markdown works in the CommonMark standard.
There is some discussion of changing the behavior if you'd like to add your voice to the standard discussion https://talk.commonmark.org/t/emphasis-and-east-asian-text/2491

@weareoutman
Copy link
Author

I filed this issue because I have a gatsbyjs@v2 site that renders the above text as expected, as far as I know, it uses the @mdx-js/mdx too (but at v1.x). Now it can not work as expected with mdx v3, so I was thinking maybe it's a regression or something.

@wooorm
Copy link
Member

wooorm commented Jan 18, 2025

No it's an improvement; this is how commonmark works everywhere, in MDX since then now too

@tats-u
Copy link

tats-u commented Jan 26, 2025

@weareoutman Could you try https://www.npmjs.com/package/remark-cjk-friendly plugin for the time being?

as far as I know, it uses the @mdx-js/mdx too (but at v1.x). Now it can not work as expected with mdx v3,

remark used in MDX v1 has not implemented this problematic feature yet.

https://docusaurus.io/docs/migration/v3#emphasis-starting-or-ending-with-a-space-or-a-punctuation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤞 phase/open Post is being triaged manually
Development

No branches or pull requests

4 participants