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

_.escape incorrectly escapes backticks #2660

Closed
inikulin opened this issue Sep 20, 2016 · 4 comments
Closed

_.escape incorrectly escapes backticks #2660

inikulin opened this issue Sep 20, 2016 · 4 comments
Labels

Comments

@inikulin
Copy link

var _ = require('lodash');

console.log(_.escape('`test`'))
// > "undefinedtestundefined"

Online example: https://runkit.com/577a60557da47e130044a1c5/57e142c26eefb414003d332e

@inikulin
Copy link
Author

I'm working on a fix

@inikulin
Copy link
Author

inikulin commented Sep 20, 2016

@jdalton I wonder if '' escaping is intententional. [HTML spec](https://html.spec.whatwg.org/#escapingString) doesn't require it to be escaped. And I don't know any cases in HTML parser in which unescaped '' can be harmful.

Update
#566 - found original PR, seems like it's required for pre-HTML5 era browsers.

@jdalton jdalton added the bug label Sep 20, 2016
@inikulin
Copy link
Author

@jdalton Wow, this was quick! Thank you!

@lock
Copy link

lock bot commented Jan 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants