feat(markdown): an option to disable adding spaces between CJK and non-CJK#8526
feat(markdown): an option to disable adding spaces between CJK and non-CJK#8526reminjp wants to merge 3 commits intoprettier:masterfrom
Conversation
|
I also use Japanese-letters, so I know that this behavior is frustrating.. I opened #6385 but I don't think we should add new option for this now. See #6385 (comment). I agree the comment. Prettier should simply keep whitespace same as the input. /cc @ikatyang How do you think? |
|
@sosukesuzuki I think the main problem with what I wrote there is line breaks. If what should Prettier replace the line break with? A space or the empty string? |
|
Because most plugins for removing linebreaks between CJK (e.g. markdown-it-cjk-breaks, hexo-filter-fix-cjk-spacing) don't treat linebreaks between CJK and non-CJK, in my opinion, it seems like a good idea to follow them and to leave a space: Input Output The reason why I focused on the behavior of plugins is the release note.
Thus, we warn users that formatting CJK text with Input 1 Output 1 ( Output 2 ( |
|
I really want this option merged into prettier and released, because I rely on prettier heavily. |
|
@uptonking We know this is a problem, but we'd like to try to solve it without adding an option. |
|
@thorn0 |
|
@uptonking no options, we will keep original input as it, if you need ensure one style on all docs, you need to use linter |
|
I agree with evilebottnawi. As I mentioned on Twitter it is NOT Prettier role. |
|
Sounds good. I am relieved to know that the discussion is continuing. Now I will close this PR because the PR is different from those plans. |
|
It looks to me from #7933 (comment) like this change to disable adding spaces is wanted but with no option in the next major release. Considering that these changes seem to simplify |
…Japanese and others Based on prettier#8526 (Thanks to @rdrgn) Differences from prettier#8526: - Don't touch on Hangul. - Change option name & type & description.
…Japanese and others Based on prettier#8526 (Thanks to @rdrgn) Differences from prettier#8526: - Don't touch on Hangul. - Change option name & type & description.
…Japanese and others Based on prettier#8526 (Thanks to @rdrgn) Differences from prettier#8526: - Don't touch on Hangul. - Change option name & type & description.
close #6385
close #5938
cjkSpacingalways: same as current behavior for Chinese and Japanesepreserve: same as current behavior for KoreansplitTextfunction insrc/language-markdown/utils.jsto implement the above optionWhile the discussion at #6385 seemed to be inactive, I was annoyed with spaces between CJK characters and non-CJK characters.
Thus, I'm working on this PR.
Before I start working on unfinished tasks (such as writing
changelog_unreleased), I would like your advice about the direction of implementation. In addition, because I'm not a native English speaker, the namings and the descriptions might be unnatural. 😖docs/directory)changelog_unreleased/*/pr-XXXX.mdfile followingchangelog_unreleased/TEMPLATE.md.✨Try the playground for this PR✨