-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a "rainbow.include-children" property for HTML
This allows us to use rainbow nesting highlights for HTML tags. The nesting node is the HTML grammar's `element` node. `<`/`>` are direct descendants of `start_tag` and `end_tag` rather than `element` though. `<`/`>` is not valid in this grammar except in cases where we want to highlight it. So we can exclude the `start_tag` and `end_tag` parents (which aren't scopes) and instead have the `element` match on any children `<`/`>`. Note that "rainbow.include-children" only applies to the scope captured with `@rainbow.scope`: any children scopes will disable the setting.
- Loading branch information
1 parent
97d0056
commit 3396f9b
Showing
3 changed files
with
28 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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
(doctype) | ||
(erroneous_end_tag) | ||
] @rainbow.scope | ||
|
||
([ | ||
(element) | ||
(script_element) | ||
(style_element) | ||
] @rainbow.scope | ||
(#set! rainbow.include-children)) | ||
|
||
["<" ">" "<!" "</" "/>"] @rainbow.bracket |