Skip to content

Commit

Permalink
Add section separators and slightly re-arrange contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Dec 18, 2024
1 parent 5917d66 commit d53acd8
Showing 1 changed file with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions Syntaxes/HTML (Blade).sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ file_extensions:

contexts:

###[ HTML TAGS ]###############################################################

prototype:
- meta_prepend: true
- include: Blade.sublime-syntax#blade-embedded
Expand All @@ -29,6 +31,12 @@ contexts:
- meta_prepend: true
- include: Blade.sublime-syntax#blade-interpolations

strings-common-content:
- meta_prepend: true
- include: Blade.sublime-syntax#blade-interpolations

###[ HTML SCRIPT TAG ]#########################################################

script-javascript-content:
- meta_include_prototype: false
- match: \s*((<!\[)(CDATA)(\[))
Expand Down Expand Up @@ -56,6 +64,8 @@ contexts:
3: source.js.embedded.html
4: comment.block.html punctuation.definition.comment.end.html

###[ HTML STYLE TAG ]##########################################################

style-css-content:
- meta_include_prototype: false
- match: \s*((<!\[)(CDATA)(\[))
Expand Down Expand Up @@ -83,10 +93,27 @@ contexts:
3: source.css.embedded.html
4: comment.block.html punctuation.definition.comment.end.html

###[ HTML TAG ATTRIBUTES ]#####################################################

tag-attributes:
- meta_prepend: true
- include: tag-blade-attributes

tag-generic-attribute:
# fixes: https://github.com/Medalink/laravel-blade/issues/196
- meta_prepend: true
- match: =
scope: punctuation.separator.key-value.html
push:
- tag-generic-attribute-meta
- tag-generic-attribute-value

tag-attribute-value-content:
- meta_prepend: true
- include: Blade.sublime-syntax#blade-interpolations

###[ COMPONENT ATTRIBUTE ]#####################################################

tag-blade-attributes:
- match: :\w+\b
scope: entity.other.attribute-name.component.blade
Expand Down Expand Up @@ -128,14 +155,7 @@ contexts:
pop: 1
- include: else-pop

tag-generic-attribute:
# fixes: https://github.com/Medalink/laravel-blade/issues/196
- meta_prepend: true
- match: =
scope: punctuation.separator.key-value.html
push:
- tag-generic-attribute-meta
- tag-generic-attribute-value
###[ EVENT ATTRIBUTE ]#########################################################

tag-event-attribute-value:
# note: only needed for backward compatibility with ST4143
Expand Down Expand Up @@ -174,6 +194,8 @@ contexts:
tag-event-attribute-value-single-quoted-content:
- include: scope:source.js.blade.embedded.string.quoted.single

###[ STYLE ATTRIBUTE ]#########################################################

tag-style-attribute-value:
# note: only needed for backward compatibility with ST4143
- meta_include_prototype: false
Expand Down Expand Up @@ -210,11 +232,3 @@ contexts:

tag-style-attribute-value-single-quoted-content:
- include: scope:source.css.blade.embedded.string.quoted.single

tag-attribute-value-content:
- meta_prepend: true
- include: Blade.sublime-syntax#blade-interpolations

strings-common-content:
- meta_prepend: true
- include: Blade.sublime-syntax#blade-interpolations

0 comments on commit d53acd8

Please sign in to comment.