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

Markdown[next branch]: Do not insert spaces between Chinese/Japanese & latin letters #11597

Merged
merged 88 commits into from Oct 19, 2022

Conversation

tats-u
Copy link
Contributor

@tats-u tats-u commented Sep 30, 2021

Description

This PR is for fixing #6385 in the coming version 3.0, and introduces the change in my hotfix plugin to the original Prettier.
Remove the option from and optimize #8526

Note: this is for the next branch, not the main branch.

If I do not have to add anything in changelog_unreleased/markdown/, I will change this to the normal (not draft) PR.

Fixes #6385

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

I just did yarn jest --updateSnapshot.


P.S. (2022-12-11)
This patch is enabled in Prettier 3.0.0-alpha.3 or later.

Copy link
Member

@sosukesuzuki sosukesuzuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I do not have to add anything in changelog_unreleased/markdown/, I will change this to the normal (not draft) PR.

This PR needs changelog! Please add it.

@tats-u tats-u force-pushed the cj-alnum-nospace branch 2 times, most recently from a09c98c to a1d9b7e Compare October 1, 2021 11:57
@tats-u tats-u marked this pull request as ready for review October 1, 2021 11:57
@tats-u
Copy link
Contributor Author

tats-u commented Oct 1, 2021

@sosukesuzuki I added one. It may have wrong usage of English words.

@sosukesuzuki sosukesuzuki added this to the 3.0 milestone Oct 3, 2021
@tats-u tats-u marked this pull request as draft October 4, 2021 13:13
@tats-u
Copy link
Contributor Author

tats-u commented Oct 4, 2021

This is not compatible with the current CI (lint). The stable version must not be used to check my changelog. This contains “第1章” (means Chapter 1), which will be spoiled (2x U+0020 will be inserted) by it. I cannot help it.

"devDependencies": {

"prettier": "2.4.0",

"scripts": {

"lint:prettier": "prettier . \"!test*\" --check",

- name: Lint Prettier
run: yarn lint:prettier

@tats-u
Copy link
Contributor Author

tats-u commented Oct 4, 2021

I wish we could test code not only by prettier . "!test*" --check but also by node ./dist/bin-prettier.js . "!test*" --check.

@tats-u tats-u marked this pull request as ready for review October 4, 2021 14:02
@tats-u
Copy link
Contributor Author

tats-u commented Oct 4, 2021

Another plan is to use my patch plugin prettier-plugin-md-nocjsp to lint only my changelog.
We only have to add it to devDependencies and .prettierrc to changelog_unreleased/markdown.

overrides:
  - files:
      - 11597.md
    options:
      parser: markdown-nocjsp

@tats-u
Copy link
Contributor Author

tats-u commented Oct 17, 2021

https://github.com/prettier/prettier/pull/11597/checks?check_run_id=3918774427

Another new PR is required.

This is not compatible with the current CI (lint). The stable version must not be used to check my changelog. This contains “第1章” (means Chapter 1), which will be spoiled (2x U+0020 will be inserted) by it. I cannot help it.

"devDependencies": {

"prettier": "2.4.0",

"scripts": {

"lint:prettier": "prettier . \"!test*\" --check",

- name: Lint Prettier
run: yarn lint:prettier

The current CI tries to use the stable version of Prettier to lint.
We have to force the CI to use bin/prettier.js at least in the next branch and its derivatives.

@tats-u
Copy link
Contributor Author

tats-u commented Oct 24, 2021

Fixed by adding one more <!-- prettier-ignore -->. Who do I have to ask to check and approve my changes?

<!-- prettier-ignore -->
Adding whitespace may interfere with searches for text containing both Chinese or Japanese and western characters. For example, you cannot find “第1章” (Chapter 1) in a Markdown document or its derivative just by searching by the string “第1章” but “第 1 章”.

@tats-u
Copy link
Contributor Author

tats-u commented Oct 24, 2021

(If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).

Do I have to do this?

@tats-u
Copy link
Contributor Author

tats-u commented May 15, 2022

Could you tell me what prevents this PR from merged?

@fisker fisker changed the title Markdown[next branch]: Do not insert spaces between Chinese/Japanese & latin letters (#6385) Markdown[next branch]: Do not insert spaces between Chinese/Japanese & latin letters May 16, 2022
@fisker
Copy link
Sponsor Member

fisker commented May 16, 2022

I think we are good to merge. Please be patient. We are still far from release v3 anyway.

@thorn0 thorn0 merged commit ebb8e13 into prettier:next Oct 19, 2022
@fisker
Copy link
Sponsor Member

fisker commented Oct 19, 2022

Great job!

@thorn0
Copy link
Member

thorn0 commented Oct 19, 2022

Thanks @tats-u ! Congrats with the end of this year-long journey. 🎉

@sosukesuzuki
Copy link
Member

Great job!!!! Thank you!!

@reminjp
Copy link

reminjp commented Oct 19, 2022

I’m glad to hear this! Great job!!

@gentksb
Copy link

gentksb commented Oct 19, 2022

Extremely great job!!!

@tats-u
Copy link
Contributor Author

tats-u commented Oct 19, 2022

@thorn0 @fisker Thank you for your cooperations and reviews.

@tats-u tats-u deleted the cj-alnum-nospace branch October 19, 2022 13:16
@kissge
Copy link

kissge commented Oct 20, 2022

Truly great work. Thanks!!

@DarkGhost7
Copy link

Thanks!!

@ice-kylin
Copy link

Is there an option to add whitespace between Chinese and Latin characters?

@fisker
Copy link
Sponsor Member

fisker commented Feb 6, 2024

No, there is no option for it, you can try https://github.com/lint-md/lint-md

Locking this PR, since it's old.

@prettier prettier locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prose wrap options for Korean Do not insert whitespaces between latin and cj letters
10 participants