Skip to content

Commit eedf9a3

Browse files
ezhloboForbesLindesay
authored andcommittedFeb 12, 2018
Don't ask escaping for boolean attributes at the beginning of attributes-list (#2956)
* Update tests: Don't ask escaping for the first boolean attribute * Don't ask escaping for the first attribute w/o value
1 parent 6f38adf commit eedf9a3

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed
 

‎packages/pug-lexer/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ Lexer.prototype = {
10191019
var whitespaceRe = /[ \n\t]/;
10201020
var quoteRe = /['"]/;
10211021

1022-
var escapedAttr = true
1022+
var escapedAttr = false
10231023
var key = '';
10241024
var val = '';
10251025
var state = characterParser.defaultState();

‎packages/pug-lexer/test/__snapshots__/index.test.js.snap

+11-11
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ Array [
634634
Object {
635635
"col": 3,
636636
"line": 3,
637-
"mustEscape": true,
637+
"mustEscape": false,
638638
"name": "foo",
639639
"type": "attribute",
640640
"val": true,
@@ -808,7 +808,7 @@ Array [
808808
Object {
809809
"col": 10,
810810
"line": 8,
811-
"mustEscape": true,
811+
"mustEscape": false,
812812
"name": "selected",
813813
"type": "attribute",
814814
"val": true,
@@ -985,7 +985,7 @@ Array [
985985
Object {
986986
"col": 3,
987987
"line": 14,
988-
"mustEscape": true,
988+
"mustEscape": false,
989989
"name": "foo",
990990
"type": "attribute",
991991
"val": true,
@@ -1159,7 +1159,7 @@ Array [
11591159
Object {
11601160
"col": 10,
11611161
"line": 19,
1162-
"mustEscape": true,
1162+
"mustEscape": false,
11631163
"name": "selected",
11641164
"type": "attribute",
11651165
"val": true,
@@ -1318,7 +1318,7 @@ Array [
13181318
Object {
13191319
"col": 5,
13201320
"line": 25,
1321-
"mustEscape": true,
1321+
"mustEscape": false,
13221322
"name": "abc",
13231323
"type": "attribute",
13241324
"val": true,
@@ -1355,7 +1355,7 @@ Array [
13551355
Object {
13561356
"col": 5,
13571357
"line": 27,
1358-
"mustEscape": true,
1358+
"mustEscape": false,
13591359
"name": "abc",
13601360
"type": "attribute",
13611361
"val": true,
@@ -1392,7 +1392,7 @@ Array [
13921392
Object {
13931393
"col": 5,
13941394
"line": 29,
1395-
"mustEscape": true,
1395+
"mustEscape": false,
13961396
"name": "abc",
13971397
"type": "attribute",
13981398
"val": true,
@@ -1429,7 +1429,7 @@ Array [
14291429
Object {
14301430
"col": 5,
14311431
"line": 31,
1432-
"mustEscape": true,
1432+
"mustEscape": false,
14331433
"name": "abc",
14341434
"type": "attribute",
14351435
"val": true,
@@ -1466,7 +1466,7 @@ Array [
14661466
Object {
14671467
"col": 5,
14681468
"line": 33,
1469-
"mustEscape": true,
1469+
"mustEscape": false,
14701470
"name": "abc",
14711471
"type": "attribute",
14721472
"val": true,
@@ -1503,7 +1503,7 @@ Array [
15031503
Object {
15041504
"col": 5,
15051505
"line": 35,
1506-
"mustEscape": true,
1506+
"mustEscape": false,
15071507
"name": "abc",
15081508
"type": "attribute",
15091509
"val": true,
@@ -16354,7 +16354,7 @@ Array [
1635416354
Object {
1635516355
"col": 21,
1635616356
"line": 7,
16357-
"mustEscape": true,
16357+
"mustEscape": false,
1635816358
"name": "something",
1635916359
"type": "attribute",
1636016360
"val": true,

0 commit comments

Comments
 (0)
Please sign in to comment.