Skip to content

Any text with \r (including with an escaped \) is removed by parser #1634

@QuinnStraus

Description

@QuinnStraus

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

  • Version: 5.2.0
  • Browser: Chrome
  • OS: Macos

Keywords

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions