-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Muliple NBSPs in code secontion in markdown string are collapsed #13485
Comments
prettier/src/language-markdown/print-preprocess.js Lines 31 to 39 in cd3e530
|
Yeah, and original the doc had 3 regular spaces |
It's collapsed by the browser. In the HTML markup, it's still 3 spaces. I'd vote for removing this Actually, according to the CommonMark spec, the only correct replacement would be to replace line endings with spaces. |
Just ran into this while editing a Another vote for dropping this behavior. |
You are right @thorn0: interior spaces should not be collapsed, according to CommonMark.
↓
I can create a PR with the fix (hopefully by the end of this week). |
Potential fix: #13590 |
Fixed by #13590 in |
Prettier 2.7.1
Playground link
Input:
Output:
Expected behavior:
I replaced regular spaces with Non-breaking spaces to prevent the collapsing of the spaces that occurs with regular spaces, but if you look at
"a b"
it shouldn't be collapsed as it renders correctly.The text was updated successfully, but these errors were encountered: