Skip to content

Commit

Permalink
Don't ask escaping for boolean attributes at the beginning of attribu…
Browse files Browse the repository at this point in the history
…tes-list (#2956)

* Update tests: Don't ask escaping for the first boolean attribute

* Don't ask escaping for the first attribute w/o value
  • Loading branch information
ezhlobo authored and ForbesLindesay committed Feb 12, 2018
1 parent 6f38adf commit eedf9a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/pug-lexer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
22 changes: 11 additions & 11 deletions packages/pug-lexer/test/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ Array [
Object {
"col": 3,
"line": 3,
"mustEscape": true,
"mustEscape": false,
"name": "foo",
"type": "attribute",
"val": true,
Expand Down Expand Up @@ -808,7 +808,7 @@ Array [
Object {
"col": 10,
"line": 8,
"mustEscape": true,
"mustEscape": false,
"name": "selected",
"type": "attribute",
"val": true,
Expand Down Expand Up @@ -985,7 +985,7 @@ Array [
Object {
"col": 3,
"line": 14,
"mustEscape": true,
"mustEscape": false,
"name": "foo",
"type": "attribute",
"val": true,
Expand Down Expand Up @@ -1159,7 +1159,7 @@ Array [
Object {
"col": 10,
"line": 19,
"mustEscape": true,
"mustEscape": false,
"name": "selected",
"type": "attribute",
"val": true,
Expand Down Expand Up @@ -1318,7 +1318,7 @@ Array [
Object {
"col": 5,
"line": 25,
"mustEscape": true,
"mustEscape": false,
"name": "abc",
"type": "attribute",
"val": true,
Expand Down Expand Up @@ -1355,7 +1355,7 @@ Array [
Object {
"col": 5,
"line": 27,
"mustEscape": true,
"mustEscape": false,
"name": "abc",
"type": "attribute",
"val": true,
Expand Down Expand Up @@ -1392,7 +1392,7 @@ Array [
Object {
"col": 5,
"line": 29,
"mustEscape": true,
"mustEscape": false,
"name": "abc",
"type": "attribute",
"val": true,
Expand Down Expand Up @@ -1429,7 +1429,7 @@ Array [
Object {
"col": 5,
"line": 31,
"mustEscape": true,
"mustEscape": false,
"name": "abc",
"type": "attribute",
"val": true,
Expand Down Expand Up @@ -1466,7 +1466,7 @@ Array [
Object {
"col": 5,
"line": 33,
"mustEscape": true,
"mustEscape": false,
"name": "abc",
"type": "attribute",
"val": true,
Expand Down Expand Up @@ -1503,7 +1503,7 @@ Array [
Object {
"col": 5,
"line": 35,
"mustEscape": true,
"mustEscape": false,
"name": "abc",
"type": "attribute",
"val": true,
Expand Down Expand Up @@ -16354,7 +16354,7 @@ Array [
Object {
"col": 21,
"line": 7,
"mustEscape": true,
"mustEscape": false,
"name": "something",
"type": "attribute",
"val": true,
Expand Down

0 comments on commit eedf9a3

Please sign in to comment.