Skip to content

Commit

Permalink
fix: issue with expression continuations containing equals
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Apr 30, 2022
1 parent 41b9e2b commit b1a3008
Show file tree
Hide file tree
Showing 4 changed files with 316 additions and 340 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-buckets-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"htmljs-parser": patch
---

Fix expression continuations containing equals not consuming enough characters
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,10 @@
│ │╰─ attrName
╰─ ╰─ tagName
66╭─ <a=x >=y a/>
│ │││ │╰─ text "=y a/>\n"
│ │││ ╰─ openTagEnd
│ ││╰─ attrValue.value
│ │├─ attrValue "=x"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x >=y"
│ │├─ attrValue "=x >=y"
│ │╰─ attrName
╰─ ╰─ tagName
67╭─ <a=x &=y a/>
Expand All @@ -507,125 +507,110 @@
│ │╰─ attrName
╰─ ╰─ tagName
68╭─ <a=x &&=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x &&=y"
│ ││├─ attrValue "=x &&=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x &&=y"
│ │├─ attrValue "=x &&=y"
│ │╰─ attrName
╰─ ╰─ tagName
69╭─ <a=x |=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x |=y"
│ ││├─ attrValue "=x |=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x |=y"
│ │├─ attrValue "=x |=y"
│ │╰─ attrName
╰─ ╰─ tagName
70╭─ <a=x ||=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x ||=y"
│ ││├─ attrValue "=x ||=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x ||=y"
│ │├─ attrValue "=x ||=y"
│ │╰─ attrName
╰─ ╰─ tagName
71╭─ <a=x ^=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x ^=y"
│ ││├─ attrValue "=x ^=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x ^=y"
│ │├─ attrValue "=x ^=y"
│ │╰─ attrName
╰─ ╰─ tagName
72╭─ <a=x ~=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x ~=y"
│ ││├─ attrValue "=x ~=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x ~=y"
│ │├─ attrValue "=x ~=y"
│ │╰─ attrName
╰─ ╰─ tagName
73╭─ <a=x >>=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x >>=y"
│ ││├─ attrValue "=x >>=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x >>=y"
│ │├─ attrValue "=x >>=y"
│ │╰─ attrName
╰─ ╰─ tagName
74╭─ <a=x >>>=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x >>>=y"
│ ││├─ attrValue "=x >>>=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x >>>=y"
│ │├─ attrValue "=x >>>=y"
│ │╰─ attrName
╰─ ╰─ tagName
75╭─ <a=x -=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x -=y"
│ ││├─ attrValue "=x -=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x -=y"
│ │├─ attrValue "=x -=y"
│ │╰─ attrName
╰─ ╰─ tagName
76╭─ <a=x /=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x /=y"
│ ││├─ attrValue "=x /=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x /=y"
│ │├─ attrValue "=x /=y"
│ │╰─ attrName
╰─ ╰─ tagName
77╭─ <a=x *=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x *=y"
│ ││├─ attrValue "=x *=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x *=y"
│ │├─ attrValue "=x *=y"
│ │╰─ attrName
╰─ ╰─ tagName
78╭─ <a=x **=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x **=y"
│ ││├─ attrValue "=x **=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x **=y"
│ │├─ attrValue "=x **=y"
│ │╰─ attrName
╰─ ╰─ tagName
79╭─ <a=x %=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x %=y"
│ ││├─ attrValue "=x %=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x %=y"
│ │├─ attrValue "=x %=y"
│ │╰─ attrName
╰─ ╰─ tagName
80╭─ <a=x +=y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x +=y"
│ ││├─ attrValue "=x +=y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x +=y"
│ │├─ attrValue "=x +=y"
│ │╰─ attrName
╰─ ╰─ tagName
81╭─ <a=x++ +y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x++ +y"
│ ││├─ attrValue "=x++ +y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x++ +y"
│ │├─ attrValue "=x++ +y"
│ │╰─ attrName
╰─ ╰─ tagName
82╭─ <a=x+ ++y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x+ ++y"
│ ││├─ attrValue "=x+ ++y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "x+ ++y"
│ │├─ attrValue "=x+ ++y"
│ │╰─ attrName
╰─ ╰─ tagName
83╭─ <a=x >y <a/>
│ ││││ ││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ││ ╰─ tagName
Expand All @@ -635,7 +620,7 @@
│ ││├─ attrValue "=x"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
╰─ ╰─ error(MISSING_END_TAG:Missing ending "a" tag) "<a=x >"
84╭─ <a=x >>y a/>
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
Expand Down Expand Up @@ -669,34 +654,36 @@
│ │╰─ tagName
╰─ ╰─ text "\n"
88╭─ <a=x =>y a/>
│ ││││ │╰─ text "y a/>\n"
│ ││││ ╰─ openTagEnd
│ │││╰─ attrValue.value "x ="
│ ││├─ attrValue "=x ="
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x =>y"
│ ││├─ attrValue "=x =>y"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
89╭─ <a=x => (y ) a/>
│ │││ │╰─ text " (y ) a/>\n"
│ │││ ╰─ openTagEnd
│ ││╰─ attrValue.value "x ="
│ │├─ attrValue "=x ="
│ │╰─ attrName
╰─ ╰─ tagName
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x => (y )"
│ ││├─ attrValue "=x => (y )"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
90╭─ <a=x => {y } a/>
│ ││││ │╰─ text " {y } a/>\n"
│ ││││ ╰─ openTagEnd
│ │││╰─ attrValue.value "x ="
│ ││├─ attrValue "=x ="
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "x => {y }"
│ ││├─ attrValue "=x => {y }"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ error(MISSING_END_TAG:Missing ending "a" tag) "<a=x =>"
╰─ ╰─ text "\n"
91╭─ <a=( x ) {y } a/>
│ │││ │╰─ openTagEnd:selfClosed "/>"
│ │││ ╰─ attrName
│ ││╰─ attrValue.value "( x ) {y }"
│ │├─ attrValue "=( x ) {y }"
│ │╰─ attrName
╰─ ╰─ tagName
│ ││││ │╰─ openTagEnd:selfClosed "/>"
│ ││││ ╰─ attrName
│ │││╰─ attrValue.value "( x ) {y }"
│ ││├─ attrValue "=( x ) {y }"
│ ││╰─ attrName
│ │╰─ tagName
╰─ ╰─ text "\n"
92╭─
╰─ ╰─ text "\n"
Loading

0 comments on commit b1a3008

Please sign in to comment.