Skip to content

Commit

Permalink
feat: highlight yaml frontmatter
Browse files Browse the repository at this point in the history
  • Loading branch information
uncenter committed Oct 23, 2024
1 parent 04a89ef commit fe8c9eb
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions syntaxes/tera.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"scopeName": "source.tera",
"fileTypes": ["tera"],
"patterns": [
{
"include": "#frontMatter"
},
{
"begin": "{#-?",
"captures": {
Expand Down Expand Up @@ -306,6 +309,36 @@
"name": "constant.character.escape.tera"
}
]
},
"frontMatter": {
"applyEndPatternLast": 1,
"begin": "\\A(?=(-{3,}))",
"end": "^ {,3}\\1-*[ \\t]*$|^[ \\t]*\\.{3}$",
"endCaptures": {
"0": {
"name": "punctuation.definition.end.frontmatter"
}
},
"patterns": [
{
"begin": "\\A(-{3,})(.*)$",
"beginCaptures": {
"1": {
"name": "punctuation.definition.begin.frontmatter"
},
"2": {
"name": "comment.frontmatter"
}
},
"contentName": "meta.embedded.block.frontmatter",
"patterns": [
{
"include": "source.yaml"
}
],
"while": "^(?! {,3}\\1-*[ \\t]*$|[ \\t]*\\.{3}$)"
}
]
}
}
}

0 comments on commit fe8c9eb

Please sign in to comment.