Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: issue with expression continuations containing equals #99

Merged
merged 1 commit into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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