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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using shouldUnescape soft hyphen (­) is not unescaped #1560
Comments
Would you like to send a Pull Request to address this? Remember to extend the existing unit tests. |
@adrai Yes, maybe. If I can figure out how to fix it. Need to look into it. |
In the issue #1435 and it's corresponding pull request #1529 you've mentioned it was decided to enable override of the default unescape behavior (which you can see here https://github.com/i18next/react-i18next/blob/d3247b5c232f5d8c1a154fe5dd0090ca88c82dcf/src/unescape.js) rather than adding additional HTML entities. So, it's now possible to provide a custom unescape function which respects any HTML entities you like - I'm doing this successfully in a project since the PR was merged. Here's a test showing roughly how to put it into config: react-i18next/test/trans.render.spec.js Line 647 in a0eed42
|
@nilsmehlhorn This is great! 馃帀 Also a lot better than adding HTML entities to a list. Sorry for not understanding that this was the outcome from that old issue. Maybe what could still be done is an update to the documentation with a clear example? I totally missed that this was possible. Anyway. Closing this now. |
馃悰 Bug Report
When using the prop
shouldUnescape
­
is not unescaped while other HTML entities like>
are.Found an old issue by @nilsmehlhorn that looks like it was closed since it has been fixed. But maybe there has been a regression?
To Reproduce
A codesandbox example forked from the old issue with updated package versions.
Expected behavior
Expected output is that
­
is unescaped as a soft hyphen.Your Environment
The text was updated successfully, but these errors were encountered: