Skip to content

Commit

Permalink
Fix {{ variables }} in FrontMatter microsoft/vscode#220022
Browse files Browse the repository at this point in the history
  • Loading branch information
RedCMD committed Jul 5, 2024
1 parent 2740099 commit 60e2e6e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 36 deletions.
25 changes: 13 additions & 12 deletions syntaxes/yaml-1.0.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,19 @@
]
},
{
"begin": "(?=\\[|{)",
"while": "\\G",
"begin": "(?={)",
"end": "$",
"patterns": [
{ "include": "#block-mapping" },
{
"begin": "(?!\\G)(?![\r\n\t ])",
"while": "\\G",
"patterns": [ { "include": "source.yaml.1.1#presentation-detail" } ]
},
{ "include": "#flow-mapping" },
{ "include": "#flow-sequence" }
{ "include": "source.yaml.1.1#presentation-detail" }
]
},
{
"begin": "(?=\\[)",
"end": "$",
"patterns": [
{ "include": "#flow-sequence" },
{ "include": "source.yaml.1.1#presentation-detail" }
]
},
{ "include": "source.yaml.1.1#block-plain-out" },
Expand All @@ -192,7 +194,7 @@
},
"block-mapping": {
"//": "The check for plain keys is expensive",
"begin": "(?=((?<=[-?:]) )?+)(?<![^\t ][\t ]*+:|---)\\G( *+)([\t ]*+)((?>[!&*][^\\x{85 2028 2029}\r\n\t ]*+[\t ]++)*+)(?=(?>(?#Double Quote)\"(?>[^\\\\\"]++|\\\\.)*+\"|(?#Single Quote)'(?>[^']++|'')*+'|(?#Plain)(?>[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ]))(?>[^:#]++|:(?![\\x{85 2028 2029}\r\n\t ])|(?<! |\t)#++)*+)?+(?#Map Value)[\t ]*+:[\\x{85 2028 2029}\r\n\t ]|(?#Explicit)\\?[\\x{85 2028 2029}\r\n\t ])|(?#Flow-Map/Seq)(?<=]|})([\t ]*+)(?=:)",
"begin": "(?=((?<=[-?:]) )?+)(?<![^\t ][\t ]*+:|---)\\G( *+)([\t ]*+)((?>[!&*][^\\x{85 2028 2029}\r\n\t ]*+[\t ]++)*+)(?=(?>(?#Double Quote)\"(?>[^\\\\\"]++|\\\\.)*+\"|(?#Single Quote)'(?>[^']++|'')*+'|(?#Flow-Map){(?>[^\\x{85 2028 2029}}]++|}[ \t]*+(?!:[\\x{85 2028 2029}\r\n\t ]))++}|(?#Flow-Seq)\\[(?>[^\\x{85 2028 2029}\\]]++|][ \t]*+(?!:[\\x{85 2028 2029}\r\n\t ]))++]|(?#Plain)(?>[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ]))(?>[^:#]++|:(?![\\x{85 2028 2029}\r\n\t ])|(?<! |\t)#++)*+)?+(?#Map Value)[\t ]*+:[\\x{85 2028 2029}\r\n\t ]|(?#Explicit)\\?[\\x{85 2028 2029}\r\n\t ])",
"while": "\\G(?>(\\1\\2)((?>[!&*][^\\x{85 2028 2029}\r\n\t ]*+[\t ]++)*+)((?>\t[\t ]*+)?+[^\\x{85 2028 2029}\r\n\t ?:\\-#!&*\"'\\[\\]{}0-9A-Za-z$()+./;<=\\\\^_~\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}])?+|( *+)([\t ]*+[^\\x{85 2028 2029}\r\n#])?+)",
"beginCaptures": {
"2": { "name": "punctuation.whitespace.indentation.yaml" },
Expand All @@ -205,8 +207,7 @@
{ "include": "source.yaml.1.1#alias" },
{ "include": "source.yaml.1.1#presentation-detail" }
]
},
"5": { "name": "punctuation.whitespace.separator.yaml" }
}
},
"whileCaptures": {
"1": { "name": "punctuation.whitespace.indentation.yaml" },
Expand Down
25 changes: 13 additions & 12 deletions syntaxes/yaml-1.1.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,19 @@
]
},
{
"begin": "(?=\\[|{)",
"while": "\\G",
"begin": "(?={)",
"end": "$",
"patterns": [
{ "include": "#block-mapping" },
{
"begin": "(?!\\G)(?![\r\n\t ])",
"while": "\\G",
"patterns": [ { "include": "#presentation-detail" } ]
},
{ "include": "#flow-mapping" },
{ "include": "#flow-sequence" }
{ "include": "#presentation-detail" }
]
},
{
"begin": "(?=\\[)",
"end": "$",
"patterns": [
{ "include": "#flow-sequence" },
{ "include": "#presentation-detail" }
]
},
{ "include": "#block-plain-out" },
Expand All @@ -270,7 +272,7 @@
},
"block-mapping": {
"//": "The check for plain keys is expensive",
"begin": "(?=((?<=[-?:]) )?+)(?<![^\t ][\t ]*+:|---)\\G( *+)([\t ]*+)((?>[!&*][^\\x{85 2028 2029}\r\n\t ]*+[\t ]++)*+)(?=(?>(?#Double Quote)\"(?>[^\\\\\"]++|\\\\.)*+\"|(?#Single Quote)'(?>[^']++|'')*+'|(?#Plain)(?>[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ]))(?>[^:#]++|:(?![\\x{85 2028 2029}\r\n\t ])|(?<! |\t)#++)*+)?+(?#Map Value)[\t ]*+:[\\x{85 2028 2029}\r\n\t ]|(?#Explicit)\\?[\\x{85 2028 2029}\r\n\t ])|(?#Flow-Map/Seq)(?<=]|})([\t ]*+)(?=:)",
"begin": "(?=((?<=[-?:]) )?+)(?<![^\t ][\t ]*+:|---)\\G( *+)([\t ]*+)((?>[!&*][^\\x{85 2028 2029}\r\n\t ]*+[\t ]++)*+)(?=(?>(?#Double Quote)\"(?>[^\\\\\"]++|\\\\.)*+\"|(?#Single Quote)'(?>[^']++|'')*+'|(?#Flow-Map){(?>[^\\x{85 2028 2029}}]++|}[ \t]*+(?!:[\\x{85 2028 2029}\r\n\t ]))++}|(?#Flow-Seq)\\[(?>[^\\x{85 2028 2029}\\]]++|][ \t]*+(?!:[\\x{85 2028 2029}\r\n\t ]))++]|(?#Plain)(?>[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FFFE FFFF}]|[?:-](?![\\x{85 2028 2029}\r\n\t ]))(?>[^:#]++|:(?![\\x{85 2028 2029}\r\n\t ])|(?<! |\t)#++)*+)?+(?#Map Value)[\t ]*+:[\\x{85 2028 2029}\r\n\t ]|(?#Explicit)\\?[\\x{85 2028 2029}\r\n\t ])",
"while": "\\G(?>(\\1\\2)((?>[!&*][^\\x{85 2028 2029}\r\n\t ]*+[\t ]++)*+)((?>\t[\t ]*+)?+[^\\x{85 2028 2029}\r\n\t ?:\\-#!&*\"'\\[\\]{}0-9A-Za-z$()+./;<=\\\\^_~\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}])?+|( *+)([\t ]*+[^\\x{85 2028 2029}\r\n#])?+)",
"beginCaptures": {
"2": { "name": "punctuation.whitespace.indentation.yaml" },
Expand All @@ -283,8 +285,7 @@
{ "include": "#alias" },
{ "include": "#presentation-detail" }
]
},
"5": { "name": "punctuation.whitespace.separator.yaml" }
}
},
"whileCaptures": {
"1": { "name": "punctuation.whitespace.indentation.yaml" },
Expand Down
25 changes: 13 additions & 12 deletions syntaxes/yaml-1.2.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,19 @@
]
},
{
"begin": "(?=\\[|{)",
"while": "\\G",
"begin": "(?={)",
"end": "$",
"patterns": [
{ "include": "#block-mapping" },
{
"begin": "(?!\\G)(?![\r\n\t ])",
"while": "\\G",
"patterns": [ { "include": "#presentation-detail" } ]
},
{ "include": "#flow-mapping" },
{ "include": "#flow-sequence" }
{ "include": "#presentation-detail" }
]
},
{
"begin": "(?=\\[)",
"end": "$",
"patterns": [
{ "include": "#flow-sequence" },
{ "include": "#presentation-detail" }
]
},
{ "include": "#block-plain-out" },
Expand All @@ -251,7 +253,7 @@
},
"block-mapping": {
"//": "The check for plain keys is expensive",
"begin": "(?=((?<=[-?:]) )?+)(?<![^\t ][\t ]*+:|---)\\G( *+)([\t ]*+)(?>((?>[!&*][^\r\n\t ]*+[\t ]++)*+)(?=(?>(?#Double Quote)\"(?>[^\\\\\"]++|\\\\.)*+\"|(?#Single Quote)'(?>[^']++|'')*+'|(?#Plain)(?>[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ]))(?>[^:#]++|:(?![\r\n\t ])|(?<! |\t)#++)*+)?+(?#Map Value)[\t ]*+:[\r\n\t ])|(?#Explicit)(?=\\?[\r\n\t ]))|(?#Flow-Map/Seq)(?<=]|})([\t ]*+)(?=:)",
"begin": "(?=((?<=[-?:]) )?+)(?<![^\t ][\t ]*+:|---)\\G( *+)([\t ]*+)(?>((?>[!&*][^\r\n\t ]*+[\t ]++)*+)(?=(?>(?#Double Quote)\"(?>[^\\\\\"]++|\\\\.)*+\"|(?#Single Quote)'(?>[^']++|'')*+'|(?#Flow-Map){(?>[^}]++|}[ \t]*+(?!:[\r\n\t ]))++}|(?#Flow-Seq)\\[(?>[^]]++|][ \t]*+(?!:[\r\n\t ]))++]|(?#Plain)(?>[\\x{85}[^-?:,\\[\\]{}#&*!|>'\"%@` \\p{Cntrl}\\p{Surrogate}\\x{FEFF FFFE FFFF}]]|[?:-](?![\r\n\t ]))(?>[^:#]++|:(?![\r\n\t ])|(?<! |\t)#++)*+)?+(?#Map Value)[\t ]*+:[\r\n\t ])|(?#Explicit)(?=\\?[\r\n\t ]))",
"while": "\\G(?>(\\1\\2)((?>[!&*][^\r\n\t ]*+[\t ]++)*+)((?>\t[\t ]*+)?+[^\r\n\t ?:\\-#!&*\"'\\[\\]{}0-9A-Za-z$()+./;<=\\\\^_~\\x{85}\\x{A0}-\\x{D7FF}\\x{E000}-\\x{FFFD}\\x{010000}-\\x{10FFFF}])?+|( *+)([\t ]*+[^\r\n#])?+)",
"beginCaptures": {
"2": { "name": "punctuation.whitespace.indentation.yaml" },
Expand All @@ -264,8 +266,7 @@
{ "include": "#alias" },
{ "include": "#presentation-detail" }
]
},
"5": { "name": "punctuation.whitespace.separator.yaml" }
}
},
"whileCaptures": {
"1": { "name": "punctuation.whitespace.indentation.yaml" },
Expand Down

0 comments on commit 60e2e6e

Please sign in to comment.