-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Prettier kills non-breaking spaces in JSX #5077
Copy link
Copy link
Closed
Labels
lang:jsxIssues affecting JSX (not general JS issues)Issues affecting JSX (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!
Milestone
Metadata
Metadata
Assignees
Labels
lang:jsxIssues affecting JSX (not general JS issues)Issues affecting JSX (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!Code is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!
Prettier 1.14.2
Playground link
Input:
Output:
BTW, the output above is what I get on the playground (still unacceptable), but not what I get in VSCode with the Prettier extension in ESLint integration mode, where I get the opening French quote mark glued to the opening JSX expr curly. Perhaps because I use the
babel-eslintparser?Expected behavior:
If I have literal unbreakable whitespace in my contents, it's for a reason. Proper French typesetting, for instance, mandates such whitespace inside French quotation marks, or before double punctuation marks (
?!:;).I used Prettier 1.13.5 so far and all was dandy. Now it strips content from my code! Not just regular ASCII space, no! Special whitespacing too! It changes the resulting display/contents my code produces, which Prettier should never ever do.
Version info
Prettier config in
package.json: