-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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 space acts different than other characters - outputs " " in template when passed via props #8895
Comments
I've added a new example - where in a list of html entities (including other whitespace and zero width characters) - only Also I've noticed that in mathiasbynens/he there are two entries for Might be a shot in the dark, but could this have any influence on the result above? |
I've tried using mathiasbynens/he v1.1.1 to find any inconsistencies with I've tried duplicating my previous jsfiddles, to see if If anyone can give me some pointers for where to look for this error, I'm more than happy to give it a shot. I would also very much appreciate any response on issue. |
Looks like a bug to me - a fix would be nice |
Ive noticed issues with |
Other example: https://jsfiddle.net/onbzk0m6/ (character ) |
Yeah - it does seem to be related the way Vue parses html attributes in general. I've made a similar example based of @approached example |
as a workaround, try to put the JS escape code for found here, worked for me in nonbreakinspacification function
strings returned by this function are being rendered with |
I stumbled upon the same issue: The html entity results in"" as text when used in templates instead of the soft hyphen. The same for "" and others. |
for folks that are looking for a workaround for this: Then, in the actual component where I need to display or use this prop, I have a computed function that undoes the above action and replaces the placeholder chars with spaces again
|
@posva Sorry to trouble you , I found a solution for this issue. After my fix, the behavior of Vue will be the same as HTML, just like the screenshot below, Can I pick up this issue and make a Pull Request? |
Sure @JuniorTour This issue might be related to #10485 and #11059 |
…and attribute (fix vuejs#8895)
…and attribute (fix vuejs#8895)
@posva |
Version
2.5.17
Reproduction link
https://codepen.io/avertes/pen/LYYpNRe
https://jsfiddle.net/50wL7mdz/756973/
Steps to reproduce
What is expected?
The output should contain a non breaking space
What is actually happening?
The output shows
In the example provided I've made 3 cases
 
get turned into
NON-BREAKING SPACE
is escaped.HTMLElement
withdocument.querySelector('#test').title
the character aren't escape.Note: When copying the non-breaking space character it might turn into a regular space in the clipboard. Therefor use https://en.wikipedia.org/wiki/Non-breaking_space#Keyboard_entry_methods to make sure how to insert the character.
The text was updated successfully, but these errors were encountered: