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
It seems like despite specifying the shouldUnescape prop to the <Trans> tag, it doesn't work with most HTML entities. Upon looking into the source code and some related issues (#1435 and #1560), it seems like it only supports an arbitrary subset of entities, and when it doesn't support the ones I'm using, I have to provide my own unescape function to interpret those symbols. This is not at all ideal; the docs make it seem like it will "just work", which is how it should be anyway.
Why doesn't the library just pass through all HTML entities to the browser as-is, and let the browser handle them when the shouldUnescape parameter is enabled?
Your Environment
runtime version: Node v14.21.3
i18next version: 15.1.1
os: Linux
The text was updated successfully, but these errors were encountered:
馃悰 Bug Report
It seems like despite specifying the
shouldUnescape
prop to the<Trans>
tag, it doesn't work with most HTML entities. Upon looking into the source code and some related issues (#1435 and #1560), it seems like it only supports an arbitrary subset of entities, and when it doesn't support the ones I'm using, I have to provide my ownunescape
function to interpret those symbols. This is not at all ideal; the docs make it seem like it will "just work", which is how it should be anyway.To Reproduce
The JSX code:
The translation JSON file:
This renders as
3 × 3 = 9
.Expected behaviour
It should render as
3 脳 3 = 9
.Why doesn't the library just pass through all HTML entities to the browser as-is, and let the browser handle them when the
shouldUnescape
parameter is enabled?Your Environment
v14.21.3
15.1.1
The text was updated successfully, but these errors were encountered: