Skip to content
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

Bug report: Utils.parseEscapedChars backslash matching #589

Closed
pro-wh opened this issue Jul 1, 2019 · 0 comments · Fixed by #664
Closed

Bug report: Utils.parseEscapedChars backslash matching #589

pro-wh opened this issue Jul 1, 2019 · 0 comments · Fixed by #664
Labels

Comments

@pro-wh
Copy link

pro-wh commented Jul 1, 2019

Describe the bug
Currently Utils.parseEscapedChars can match up to three backslashes in a replacement, which I think is unintended. As an example problem case, \\\\\\ unescapes to \\\\ instead of \\\. The reproduction link below does a round trip with escape, then unescape.

Following #582, I think we don't need the leading (\\)? and if (a === "\\") anymore. If there's an escaped backslash, it'll match with b equal to \, and whatever comes after will not be affected by the replace operation.

To Reproduce

  • Version: 8.34.2
  • Compile time: 28/06/2019 16:17:13 UTC
  • User-Agent:
    Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
  • Link to reproduce

Expected behavior
The output should be \\\.

@pro-wh pro-wh added the bug label Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant