mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Add comment to _.escape.
Former-commit-id: bee148c238552d3cdb6bba3a3511f3d0c5484850
This commit is contained in:
@@ -2675,6 +2675,9 @@
|
||||
* // => "Curly, Larry & Moe"
|
||||
*/
|
||||
function escape(string) {
|
||||
// the `>` character doesn't require escaping in HTML and has no special
|
||||
// meaning unless it's part of an open tag
|
||||
// http://mathiasbynens.be/notes/ambiguous-ampersands (semi-related fun fact)
|
||||
return (string + '')
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
|
||||
Reference in New Issue
Block a user