microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.3k stars 29.31k forks source link

Markdown goes wrong when interprets some CJK characters #95284

Closed LittleYe233 closed 4 years ago

LittleYe233 commented 4 years ago

I have found that some formats (like bold, italic, deleting line) can't be shown well when these special characters are between certain CJK characters.

I have tested in some situations and the testing results are as below.

Code Preview in Code Result Notes
~~aaa~~ aaa OK All letters
~~(~~ OK Chinese bracket
aa~~(~~ aa Failed Chinese bracket and letter
aa~~aa~~ aaaa OK Both letters
符号~~aa~~ 符号aa OK Chinese characters and letters
符号~~符号~~ 符号\~\~符号\~\~ Failed All Chinese characters. And it can be shown by Github Markdown but failed in VSCode Markdown.

Other grammers have the similar errors too. Test results about them are omitted.

I use strapdown.js to interpret the markdown codes above and they are shown well. So I think the Markdown interpreter in VSCode may have some bugs.

Steps to Reproduce:

  1. Create a new Markdown file.
  2. Write the codes.
  3. Click the 'preview' button and check the results.

Does this issue occur when all extensions are disabled?: Yes

mjbvz commented 4 years ago

The markdown preview uses markdown-it for rendering and I believe I see the same behavior in the markdown-it demo

Please file this issue upstream against markdown-it since we cannot fix this on the VS Code side

LittleYe233 commented 4 years ago

@mjbvz I found the same issue on 'markdown-it'. Thanks for your answer!