Revert "Escape = in HTML content"

This reverts commit 1c863e34, a change that was illegal in a patch (by semver semantics).

see #1489
This commit is contained in:
Nils Knappmeier
2018-12-31 08:16:57 +01:00
committed by Nils Knappmeier
parent af919d2348
commit 6e9dbac8e9
2 changed files with 8 additions and 5 deletions
+5 -4
View File
@@ -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, const badChars = /[&<>"'`]/g,
possible = /[&<>"'`=]/; possible = /[&<>"'`]/;
function escapeChar(chr) { function escapeChar(chr) {
return escape[chr]; return escape[chr];
+3 -1
View File
@@ -18,7 +18,9 @@ describe('utils', function() {
describe('#escapeExpression', function() { describe('#escapeExpression', function() {
it('shouhld escape html', function() { it('shouhld escape html', function() {
equals(Handlebars.Utils.escapeExpression('foo<&"\'>'), 'foo&lt;&amp;&quot;&#x27;&gt;'); equals(Handlebars.Utils.escapeExpression('foo<&"\'>'), 'foo&lt;&amp;&quot;&#x27;&gt;');
equals(Handlebars.Utils.escapeExpression('foo='), 'foo&#x3D;'); });
it('should not escape the equals-sign in 3.x (#1489)', function() {
equals(Handlebars.Utils.escapeExpression('foo='), 'foo=');
}); });
it('should not escape SafeString', function() { it('should not escape SafeString', function() {
var string = new Handlebars.SafeString('foo<&"\'>'); var string = new Handlebars.SafeString('foo<&"\'>');