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 being stripped #4806

Closed
matt0987 opened this issue Nov 7, 2019 · 2 comments
Closed

Non breaking spaces being stripped #4806

matt0987 opened this issue Nov 7, 2019 · 2 comments

Comments

@matt0987
Copy link

matt0987 commented Nov 7, 2019

Version

4.0.5

Environment info

no command :/ couldn't find anything about what vue info does so ¯\_(ツ)_/¯ 

Steps to reproduce

Add non breaking space characters. eg, in a component:

{{ text }}< template v-if="something">& nbsp ;< specialComponent />< /template>

they are stripped out by default and replaced with an ordinary space. (ignore the weird spaces. i needed some way to make those things appear in the form preview)

if i'm adding a non breaking space then there's a high chance i need it.
you can't even add a non breaking space with & nbsp ; but instead need to use {{ '\xa0' }}

What is expected?

non breaking spaces are preserved

What is actually happening?

non breaking spaces are removed and replaced with one ordinary space

non breaking spaces can only be added with what's pretty much an ugly hack

@sodatea
Copy link
Member

sodatea commented Nov 7, 2019

If you are looking for a configuration option then here it is: https://github.com/vuejs/vue/tree/dev/packages/vue-template-compiler#options (whitespace or preserveWhitespace)

If not, please report to https://github.com/vuejs/vue with the required minimal reproduction link.

@sodatea sodatea closed this as completed Nov 7, 2019
@Tofandel
Copy link

Tofandel commented Sep 16, 2020

This is a bug. whitespace: condense should not remove &nbsp;, they are not whitespaces but non breaking spaces and there is a difference, if it is being added with an html entity vue should definitely not remove it or convert it to a normal space but currently that's not the case, they are being stripped down and converted to normal spaces

Since this issue is actually the most referenced in google for some reason, here are the active and open PR/Issues
#5639
vuejs/vue#11065

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants