Skip to content

Commit

Permalink
fix: add highlighting for else if
Browse files Browse the repository at this point in the history
  • Loading branch information
joerdav committed Aug 10, 2023
1 parent baaab62 commit 614822d
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions syntaxes/templ.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@
{
"include": "#close-element"
},
{
"include": "#else-if-expression"
},
{
"include": "#if-expression"
},
Expand Down Expand Up @@ -234,8 +237,8 @@
"name": "expression.html-template.templ"
},
"if-expression": {
"begin": "^\\s*if .+?{$",
"end": "(^\\s*}$)|(^\\s*}(?=\\s*else\\s*{$))",
"begin": "^\\s*if .+?{\\s*$",
"end": "(^\\s*}$)|(^\\s*}(?=\\s*else\\s*{$))|(^\\s*}(?=\\s*else\\s*if .+?{\\s*$))",
"captures": {
"0": {
"name": "meta.embedded.block.go",
Expand All @@ -254,7 +257,7 @@
"name": "if.html-template.templ"
},
"else-expression": {
"begin": "\\s+else\\s+{$",
"begin": "\\s+else\\s+{\\s*$",
"end": "^\\s*}$",
"captures": {
"0": {
Expand All @@ -271,6 +274,26 @@
"include": "#template-node"
}
],
"name": "else.html-template.templ"
},
"else-if-expression": {
"begin": "\\s+else\\s+if .+?{\\s*$",
"end": "(^\\s*}$)|(^\\s*}(?=\\s*else\\s*{$))|(^\\s*}(?=\\s*else\\s*if .+?{\\s*$))",
"captures": {
"0": {
"name": "meta.embedded.block.go",
"patterns": [
{
"include": "source.go"
}
]
}
},
"patterns": [
{
"include": "#template-node"
}
],
"name": "else.if.html-template.templ"
},
"for-expression": {
Expand Down

0 comments on commit 614822d

Please sign in to comment.