-
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.
feat: improve js style comment support (#119)
- Loading branch information
1 parent
112cf54
commit 28fde07
Showing
8 changed files
with
115 additions
and
11 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 | ||
--- | ||
|
||
Support JS line comments inside the open tag (previously just block comments could be used). |
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 | ||
--- | ||
|
||
Support JS style comments in HTML bodies (previously allowed in parsed text and concise mode). |
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,4 @@ | ||
<div foo="bar" /*this is a comment*/ hello="world" /* this is another comment */ ></div> | ||
<div foo="bar" /*this is a comment*/ hello="world" /* this is another comment */ ></div> | ||
<div foo="bar" // this is a test | ||
hello="world" // this is another test | ||
></div> |
24 changes: 24 additions & 0 deletions
24
...s__/fixtures/comments-within-tag-body/__snapshots__/comments-within-tag-body.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
1╭─ <div> | ||
│ ││ ╰─ openTagEnd | ||
│ │╰─ tagName "div" | ||
╰─ ╰─ openTagStart | ||
2╭─ // This is a comment | ||
│ │ │ ╰─ comment.value " This is a comment" | ||
│ │ ╰─ comment "// This is a comment" | ||
╰─ ╰─ text "\n " | ||
3╭─ This is some real text | ||
╰─ ╰─ text "\n This is some real text\n " | ||
4╭─ /* But this is a comment */ | ||
│ │ ╰─ comment.value " But this is a comment " | ||
╰─ ╰─ comment "/* But this is a comment */" | ||
5╭─ And this is more text | ||
╰─ ╰─ text "\n And this is more text\n " | ||
6╭─ <!-- and this is a comment --> | ||
│ │ ╰─ comment.value " and this is a comment " | ||
╰─ ╰─ comment "<!-- and this is a comment -->" | ||
7╭─ </div> | ||
│ │ │ ╰─ closeTagEnd(div) | ||
│ │ ╰─ closeTagName "div" | ||
│ ├─ text "\n" | ||
╰─ ╰─ closeTagStart "</" | ||
8╰─ |
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,7 @@ | ||
<div> | ||
// This is a comment | ||
This is some real text | ||
/* But this is a comment */ | ||
And this is more text | ||
<!-- and this is a comment --> | ||
</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