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

Non-breaking spaces get killed #188

Open
simonc opened this issue Sep 9, 2023 · 2 comments
Open

Non-breaking spaces get killed #188

simonc opened this issue Sep 9, 2023 · 2 comments
Labels
Bug Something isn't working Severity: 4 theme bugs that won't be prioritized in the near future

Comments

@simonc
Copy link

simonc commented Sep 9, 2023

Describe the bug

Non-breaking spaces handling has been added in Prettier 1.16.2 and is still present today. When using prettier-plugin-liquid though, non-breaking spaces in the content get replaced with normal spaces. This has a negative impact on content written in a language where non-breaking spaces are used with punctuation, like French.

Unformatted source

(I'm using a here to represent the non-breaking space)

<p>Prix•: {{price}}€</p>

Expected output

<p>Prix•: {{ price }}€</p>

Actual output

<p>Prix : {{ price }}€</p>

Debugging information

  • OS Mac
  • Version 1.2.3
@simonc simonc added the Bug Something isn't working label Sep 9, 2023
@charlespwd
Copy link
Contributor

Note that the browser wouldn't see the difference though, shouldn't that be a &nbsp;?

@charlespwd charlespwd transferred this issue from Shopify/prettier-plugin-liquid Oct 23, 2023
@simonc
Copy link
Author

simonc commented Oct 23, 2023

Hi @charlespwd 😊 It could be one but it doesn't have to be and the browser does respect a non-breaking space even if it's not using an entity code. I simplified the example here, but in the case of a longer content used for the title of a page for instance, unexpectedly changing the space type does have an unfortunate impact on the final design 🙈

@mgmanzella mgmanzella added the Severity: 4 theme bugs that won't be prioritized in the near future label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Severity: 4 theme bugs that won't be prioritized in the near future
Projects
None yet
Development

No branches or pull requests

3 participants