-
-
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 characters passed via props are double-escaped in component template output #6981
Comments
The browser is escaping it before passing it as an attribute. Add |
I've made 3 cases in the jsfiddle below - that might help explain the problem.
|
@s-robertson @posva @eibx Jumping in late, but I can verify this is happening with Here is the character in question, for reference:
And here's the error we were seeing before replacing the
|
@mikermcneil I've made an example in #8895 that shows that all attributes in a Vue context doesn't handle non-breaking spaces. |
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
|
* api * api * api * 6.7 * 6.7 * 6.7 * 6.7 * api * bugfix * api * api * focusviewer * api * api * api * api * api * api * api * api * api * 6.8 * 6.8 * 6.8 * 6.8 * 6.8 * 6.8 * 6.8 * api * 修复IE无法正确解析slot-scope的错误。vuejs/vue#6981 (comment) * Set up CI with Azure Pipelines * repository pattern * repository pattern * repository pattern * unit tests * dynamic * db * netcore * nuxt * core * core * datory * datory * core Co-authored-by: starlying <starlying@gmail.com> Co-authored-by: liangminhua <ben302010@live.cn> Co-authored-by: tim <starlying@users.noreply.github.com>
I see this closed, but I do not see the reason why since a fix is not provided. |
PR #11599 will fix this issue: Fixed Reproduction link: https://jsfiddle.net/juniortour/q2dxc65h/After:Before: |
Thanks, Junior, it looks like it is not being reviewed by anyone yet :( |
Hey @posva I see you closed this one, but the PR with the fix is not approved, is there a procedure to get it approved? Thanks. |
Version
2.5.2
Reproduction link
https://jsfiddle.net/srobertson203/98Lp2ch0/
Steps to reproduce
What is expected?
The non-breaking space character should be escaped as an HTML entity in the raw HTML, but appear as a normal space in the rendered HTML.
What is actually happening?
The non-breaking space character is double-escaped as an HTML entity and instead appears as
in the rendered HTML.As shown in the jsfiddle, all other characters that should be escaped as HTML entities (such as
&
and<
or>
)are behaving as expected. It's only the non-breaking space character that's double-escaped.The text was updated successfully, but these errors were encountered: