-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Prettier currently replaces all non-breaking spaces with standard space characters.
This makes sense in JavaScript or other source file formats where they may have been entered inadvertently — but when they appear in Markdown, they are most likely intentional and should not be discarded.
(In prose writing, non-breaking spaces are often essential to keep numbers and units together, or ensure multi-word product names aren't torn apart.)
Prettier 1.8.2
Playground link
--parser markdown
Input:
keep•these•words•together
(the • character is used above to represent non-breaking spaces)
Output:
keep these words together
Expected behavior:
keep•these•words•together
To support this use case, the markdown
parser defaults should be adjusted to preserve non-breaking spaces, or a new configuration option added that allows users to enable this behavior as required.