Skip to content

Commit

Permalink
Invalidate BOM inside plain strings
Browse files Browse the repository at this point in the history
  • Loading branch information
RedCMD committed Jun 29, 2024
1 parent 2088376 commit 515caa2
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion syntaxes/yaml-1.2.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@
"match": "[\t ]++$",
"name": "punctuation.whitespace.separator.yaml"
},
{
"match": "\\x{FEFF}",
"name": "invalid.illegal.bom.yaml"
},
{ "include": "#non-printable" }
]
},
Expand Down Expand Up @@ -511,6 +515,10 @@
"match": "[\t ]++$",
"name": "punctuation.whitespace.separator.yaml"
},
{
"match": "\\x{FEFF}",
"name": "invalid.illegal.bom.yaml"
},
{ "include": "#non-printable" }
]
},
Expand Down Expand Up @@ -712,6 +720,10 @@
"match": ":(?=[\r\n\t ,\\[\\]{}])",
"name": "invalid.illegal.multiline-key.yaml"
},
{
"match": "\\x{FEFF}",
"name": "invalid.illegal.bom.yaml"
},
{ "include": "#non-printable" }
]
},
Expand All @@ -730,6 +742,10 @@
"match": "[\t ]++$",
"name": "punctuation.whitespace.separator.yaml"
},
{
"match": "\\x{FEFF}",
"name": "invalid.illegal.bom.yaml"
},
{ "include": "#non-printable" }
]
},
Expand All @@ -740,6 +756,10 @@
"name": "meta.flow.map.key.yaml string.unquoted.other.in.yaml entity.name.tag.yaml",
"patterns": [
{ "include": "#tag-implicit-plain-in" },
{
"match": "\\x{FEFF}",
"name": "invalid.illegal.bom.yaml"
},
{ "include": "#non-printable" }
]
},
Expand Down Expand Up @@ -1086,7 +1106,7 @@
},
"comment": {
"comment": "Comments must be separated from other tokens by white space characters. `space`, `tab`, `newline` or `carriage-return`. `#(.*)` causes performance issues",
"begin": "(?<= |\t|^)#",
"begin": "(?<=[\\x{FEFF}\t ]^)#",
"end": "\r|\n",
"captures": { "0": { "name": "punctuation.definition.comment.yaml" } },
"name": "comment.line.number-sign.yaml",
Expand Down

0 comments on commit 515caa2

Please sign in to comment.