You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a value containing a forward slash is passed to the Trans component, it is not unescaped, but rather is output as /. Other HTML-escaped characters (eg. & ' " < >) are unescaped correctly.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
🐛 Bug Report
If a value containing a forward slash is passed to the
Trans
component, it is not unescaped, but rather is output as/
. Other HTML-escaped characters (eg.& ' " < >
) are unescaped correctly.To Reproduce
Sample code:
Code Sandbox link: https://codesandbox.io/s/blazing-cherry-q4g4z9?file=/src/App.js
Expected behavior
The output should look like
& < > ' " /
Actual behaviour
The output looks like
& < > ' " /
Your Environment
Notes
The escaping seems to be done in i18next's utils.js - note that forward slash is included in
_entityMap
: https://github.com/i18next/i18next/blob/master/src/utils.js#L125But the unescaping is done by
html-escaper
- https://github.com/WebReflection/html-escaper/blob/master/index.js which does not appear to know how to unescape/
.The text was updated successfully, but these errors were encountered: