-
-
Notifications
You must be signed in to change notification settings - Fork 861
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
Add a constructor config flag that automatically escapes html in parameters #1002
Labels
Comments
kazupon
added
Status: Proposal
Request for comments
Type: Feature
Includes new features
labels
Sep 13, 2020
If this feature aligns with the project philosophy I could implement it and submit a PR. @kazupon Please let me know and I'll get to it. |
Sorry, lately my reply. That sounds good. |
gardarh
pushed a commit
to gardarh/vue-i18n
that referenced
this issue
Oct 6, 2020
gardarh
pushed a commit
to gardarh/vue-i18n
that referenced
this issue
Oct 6, 2020
gardarh
pushed a commit
to gardarh/vue-i18n
that referenced
this issue
Oct 6, 2020
gardarh
pushed a commit
to gardarh/vue-i18n
that referenced
this issue
Oct 6, 2020
kazupon
pushed a commit
that referenced
this issue
Oct 6, 2020
Co-authored-by: Gardar Hauksson <[email protected]>
Merged. |
gardarh
pushed a commit
to gardarh/vue-i18n
that referenced
this issue
Oct 6, 2020
exoego
added a commit
that referenced
this issue
Oct 6, 2020
…po-in-readme Fix typo, espaceParameterHtml -> escapeParameterHtml in README. #1002
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In some cases using component interpolation is inconvenient (example case when a string needs to be crafted in code and sent into a child component).
I commonly use "minor" html tags in translation strings, e.g. the
<b>
tag. However this causes a very subtle XSS attack vector where I need to be very careful not to pass user input directly as interpolation parameters.I would like to be able to send a flag (e.g.
escapeParameterHtml
) into the VueI18n constructor:This would add the following step to the
BaseFormatter.interpolate
, roughly so:If I could create a custom formatter that extended the
BaseFormatter
this would be simple to do without modifying the library but unfortunately theBaseFormatter
class is not exported.The text was updated successfully, but these errors were encountered: