From d89f76a831588a991b2406418066a2fb9b2df692 Mon Sep 17 00:00:00 2001 From: Eugene Zhlobo Date: Sun, 11 Feb 2018 22:36:35 +0300 Subject: [PATCH 1/2] Update tests: Don't ask escaping for the first boolean attribute --- .../test/__snapshots__/index.test.js.snap | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/pug-lexer/test/__snapshots__/index.test.js.snap b/packages/pug-lexer/test/__snapshots__/index.test.js.snap index 527b5da6b..368020744 100644 --- a/packages/pug-lexer/test/__snapshots__/index.test.js.snap +++ b/packages/pug-lexer/test/__snapshots__/index.test.js.snap @@ -634,7 +634,7 @@ Array [ Object { "col": 3, "line": 3, - "mustEscape": true, + "mustEscape": false, "name": "foo", "type": "attribute", "val": true, @@ -808,7 +808,7 @@ Array [ Object { "col": 10, "line": 8, - "mustEscape": true, + "mustEscape": false, "name": "selected", "type": "attribute", "val": true, @@ -985,7 +985,7 @@ Array [ Object { "col": 3, "line": 14, - "mustEscape": true, + "mustEscape": false, "name": "foo", "type": "attribute", "val": true, @@ -1159,7 +1159,7 @@ Array [ Object { "col": 10, "line": 19, - "mustEscape": true, + "mustEscape": false, "name": "selected", "type": "attribute", "val": true, @@ -1318,7 +1318,7 @@ Array [ Object { "col": 5, "line": 25, - "mustEscape": true, + "mustEscape": false, "name": "abc", "type": "attribute", "val": true, @@ -1355,7 +1355,7 @@ Array [ Object { "col": 5, "line": 27, - "mustEscape": true, + "mustEscape": false, "name": "abc", "type": "attribute", "val": true, @@ -1392,7 +1392,7 @@ Array [ Object { "col": 5, "line": 29, - "mustEscape": true, + "mustEscape": false, "name": "abc", "type": "attribute", "val": true, @@ -1429,7 +1429,7 @@ Array [ Object { "col": 5, "line": 31, - "mustEscape": true, + "mustEscape": false, "name": "abc", "type": "attribute", "val": true, @@ -1466,7 +1466,7 @@ Array [ Object { "col": 5, "line": 33, - "mustEscape": true, + "mustEscape": false, "name": "abc", "type": "attribute", "val": true, @@ -1503,7 +1503,7 @@ Array [ Object { "col": 5, "line": 35, - "mustEscape": true, + "mustEscape": false, "name": "abc", "type": "attribute", "val": true, @@ -16354,7 +16354,7 @@ Array [ Object { "col": 21, "line": 7, - "mustEscape": true, + "mustEscape": false, "name": "something", "type": "attribute", "val": true, From 15916049751bc778fe5817732483371dab5f19d7 Mon Sep 17 00:00:00 2001 From: Eugene Zhlobo Date: Sun, 11 Feb 2018 22:37:58 +0300 Subject: [PATCH 2/2] Don't ask escaping for the first attribute w/o value --- packages/pug-lexer/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pug-lexer/index.js b/packages/pug-lexer/index.js index 73114efea..c4f3db5c3 100644 --- a/packages/pug-lexer/index.js +++ b/packages/pug-lexer/index.js @@ -1019,7 +1019,7 @@ Lexer.prototype = { var whitespaceRe = /[ \n\t]/; var quoteRe = /['"]/; - var escapedAttr = true + var escapedAttr = false var key = ''; var val = ''; var state = characterParser.defaultState();