From 6e9dbac8e943095b86c0cfeed49a6946c3dc14e3 Mon Sep 17 00:00:00 2001 From: Nils Knappmeier Date: Mon, 31 Dec 2018 08:16:57 +0100 Subject: [PATCH] Revert "Escape = in HTML content" This reverts commit 1c863e34, a change that was illegal in a patch (by semver semantics). see #1489 --- lib/handlebars/utils.js | 9 +++++---- spec/utils.js | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js index fc6dcfb6..b84df49c 100644 --- a/lib/handlebars/utils.js +++ b/lib/handlebars/utils.js @@ -4,12 +4,13 @@ const escape = { '>': '>', '"': '"', "'": ''', - '`': '`', - '=': '=' + '`': '`' + // The "equals-sign" is intentionally excluded from this list + // due to semantic-versioning issues (see #1489) }; -const badChars = /[&<>"'`=]/g, - possible = /[&<>"'`=]/; +const badChars = /[&<>"'`]/g, + possible = /[&<>"'`]/; function escapeChar(chr) { return escape[chr]; diff --git a/spec/utils.js b/spec/utils.js index 7248ac44..79080963 100644 --- a/spec/utils.js +++ b/spec/utils.js @@ -18,7 +18,9 @@ describe('utils', function() { describe('#escapeExpression', function() { it('shouhld escape html', function() { equals(Handlebars.Utils.escapeExpression('foo<&"\'>'), 'foo<&"'>'); - equals(Handlebars.Utils.escapeExpression('foo='), 'foo='); + }); + it('should not escape the equals-sign in 3.x (#1489)', function() { + equals(Handlebars.Utils.escapeExpression('foo='), 'foo='); }); it('should not escape SafeString', function() { var string = new Handlebars.SafeString('foo<&"\'>');