-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: regression with comments inside parsed text state (#132)
- Loading branch information
1 parent
ab0abcf
commit 59a10d5
Showing
8 changed files
with
55 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"htmljs-parser": patch | ||
--- | ||
|
||
Fix regression which caused script tags with a trailing comment as the same line as the closing tag to not always parse properly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"htmljs-parser": patch | ||
--- | ||
|
||
Remove unecessary check for cdata inside parsed text state. |
12 changes: 3 additions & 9 deletions
12
src/__tests__/fixtures/cdata/__snapshots__/cdata.expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
1╭─ <html-comment><![CDATA[[if lt IE 9]><div><![endif]]]></html-comment> | ||
│ ││ ││ │ │ │ ╰─ closeTagEnd(html-comment) | ||
│ ││ ││ │ │ ╰─ closeTagName "html-comment" | ||
│ ││ ││ │ ╰─ closeTagStart "</" | ||
│ ││ ││ ╰─ cdata.value "[if lt IE 9]><div><![endif]" | ||
│ ││ │╰─ cdata "<![CDATA[[if lt IE 9]><div><![endif]]]>" | ||
│ ││ ╰─ openTagEnd | ||
│ │╰─ tagName "html-comment" | ||
╰─ ╰─ openTagStart | ||
1╭─ <![CDATA[[if lt IE 9]><div><![endif]]]> | ||
│ │ ╰─ cdata.value "[if lt IE 9]><div><![endif]" | ||
╰─ ╰─ cdata "<![CDATA[[if lt IE 9]><div><![endif]]]>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<html-comment><![CDATA[[if lt IE 9]><div><![endif]]]></html-comment> | ||
<![CDATA[[if lt IE 9]><div><![endif]]]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
<script>// this is a comment</script> | ||
<script>// this is a comment</script> | ||
<div> | ||
<script>// this is a comment</script> | ||
<span>hi</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters