-
-
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
HTML entities in attributes are not always decoded for string templates #8805
Comments
This is not related to whether the component is asynchronous or not. Non-asynchronous components also have this problem. Vue's html-parser will only process the following entity content: const decodingMap = {
'<': '<',
'>': '>',
'"': '"',
'&': '&',
' ': '\n',
'	': '\t'
} it's here: https://github.com/vuejs/vue/blob/dev/src/compiler/parser/html-parser.js#L38-L45. |
So ''' should be added to the map? Update: https://jsfiddle.net/sf9cg0db/12/ |
It would not be better to use something like this package? |
Actually Vue is already using |
Version
2.5.17
Reproduction link
https://jsfiddle.net/sf9cg0db/
Steps to reproduce
Try to dynamically load an input field with a value that contains an encoded single quote (') as plain HTML. Normally the input field will display the single quote in the input box. However, Vue shows the ' in the input box.
I tested this with multiple encoded chars, and everything works correctly, except for the single quote.As stated by @HcySunYang, all entities except the 6 he listed have this issue.What is expected?
A single quote is shown in the input field when loaded async with Vue
What is actually happening?
' is show in the input field when loaded async with Vue
The text was updated successfully, but these errors were encountered: