From 1a1bd5322c94429e7b7817beb157220c8770b863 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 3 May 2012 00:45:21 -0400 Subject: [PATCH] lodash: No longer have `escape` translate the ">" character. [jddalton, mathiasbynens] Former-commit-id: 58d8ef98f3699a62b57a460b45921785fa2440b0 --- lodash.js | 3 +-- test/test.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index f179b6690..228270705 100644 --- a/lodash.js +++ b/lodash.js @@ -2352,7 +2352,7 @@ /*--------------------------------------------------------------------------*/ /** - * Escapes a string for insertion into HTML, replacing `&`, `<`, `>`, `"`, `'`, + * Escapes a string for insertion into HTML, replacing `&`, `<`, `"`, `'`, * and `/` characters. * * @static @@ -2369,7 +2369,6 @@ return (string + '') .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, ''') .replace(/\//g,'/'); diff --git a/test/test.js b/test/test.js index 07988749b..b9b808685 100644 --- a/test/test.js +++ b/test/test.js @@ -112,6 +112,16 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.escape'); + + (function() { + test('should not escape the ">" character', function() { + equal(_.escape('>'), '>'); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.forEach'); (function() {