-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Less than sign <
breaks tag parsing with Trans component
#1734
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
Less than sign <
breaks tag parsing with Trans component
#1734
Comments
feel free to try to provide a PR to address this |
This also happens for interpolated values with a "<". These values are often provided by the user, so we can't control them. Is there any workaround for that? |
fyi: waiting for this PR to be approved by @HenrikJoreteg ... I'm also ok with taking over the html-parse-stringify repository if Henrik has no interest in maintaining it anymore... (I already have the npm publish permissions, but not yet the github repo write permission) |
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. |
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. |
Uh oh!
There was an error while loading. Please reload this page.
🐛 Bug Report
A translation string with less than sign
<
breaks the tag parsing with<Trans>
componentTo Reproduce
Add this test case to
test/trans.render.object.spec.jsx
: (modifying the test case on line 65 there)Run
npm test
, it fails with outputExpected behavior
The test should pass.
The problem is that having a less than sign (
<
) within the translated text breaks the system extracting the tags.The text between the
<
sign and the next tag opening won't be rendered at all. The next tag won't be rendered correctly.I assume that in the test case snippet, it reads the following as the tag:
<10 this text after the sign should be rendered <bold>
Your Environment
master
, 14.1.0The text was updated successfully, but these errors were encountered: