-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Any text with \r (including with an escaped \) is removed by parser #1634
Comments
I have just encountered the same issue which has broken equations containing 👍 Nicely explained and reproduced @QuinnStraus. |
Thanks for opening this issue! It's related to remarkablemark/html-dom-parser#902. I wonder what's the best way to fix this without adding more complexity. Do you think introducing another option makes sense? E.g.: parse(html, {
escapeCarriageReturn: true, // defaults to false
}); |
I don't think there is necessarily a conflict here, since in the raw string the latex \right will have an escaped backslash (\\right), so given that the original issue was about the character \r it should be fine. After looking at the pull request it seems like it
I think a fix would be to replace \r with a string that is not likely to be used, such as |
Thanks for your help on this issue! Can you verify that the bug has been fixed in: |
Does seem to be working now! Thanks for your quick fix! |
Expected Behavior
In a text document use of an escaped backslash before an r character should not remove the r character. This is necessary for eg. latex, where commands like \right) are common.
Actual Behavior
All \r are removed from the html document, even if the raw string is formatted as "\\r".
This seems to have been caused by the fix to #864
Steps to Reproduce
Create a html document with \\r inside the html string, run it through the html parser.
Reproducible Demo
https://stackblitz.com/edit/html-react-parser-typescript-w9j4u9vu?file=src%2Findex.tsx
Environment
Keywords
The text was updated successfully, but these errors were encountered: