Do not insert whitespaces between latin and cj letters
Problem
Environments: - Prettier Version: 1.18.2 Steps to reproduce: [code block] Expected behavior: [code block] Actual behavior: [code block] *** For now, Prettier inserts whitespace between latin and Japanese/Chinese on formatting Markdown. As mentioned in #5938, this is not good behavior for Japanese, but correct for Chinese. I tried to avoid this problem in the same way as handling Korean language, but it was impossible because Japanese and Chinese uses same Kanji letter, with same char code. From above reason, I think we should add new option like `add-whitespace-between-latin-and-cj` to determine whether whitespace is inserted between latin and cj. Of cource it's the best if there is the way to distinguish Japanese and Chinese.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Do not insert whitespaces between latin and cj letters
> While not adding option is good but removing a feature is not a good idea IMO. From what I saw on Twitter, some people did enjoy using this feature. I'm not sure how uncommon it is for Japanese but it's [the recommended format for Chinese [Chinese docs]](https://github.com/ruanyf/document-style-guide/blob/master/docs/text.md) at least. If we're going to remove this feature, I'd say we should pro
Trust Score
5 verifications
- 1
> While not adding option is good but removing a feature is not a good idea IMO.
> While not adding option is good but removing a feature is not a good idea IMO. From what I saw on Twitter, some people did enjoy using this feature. I'm not sure how uncommon it is for Japanese but it's [the recommended format for Chinese [Chinese docs]](https://github.com/ruanyf/document-style-guide/blob/master/docs/text.md) at least. If we're going to remove this feature, I'd say we should provide some alternative tools (or plugins) at the same time so that we won't bother people too much.
- 2
No. Your reference is just a personal guide in chinese world. Check this officia
No. Your reference is just a personal guide in chinese world. Check this official text layout guide.
- 3
In a word, the space between cjk characters and latin characters is a pollution.
In a word, the space between cjk characters and latin characters is a pollution. This work should be done by the layout engine instead of changing the text directly. So i think at least there should be an option to close this "feature" while removing it is a more wise action.
Validation
Resolved in prettier/prettier GitHub issue #6385. Community reactions: 11 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep