Skip to content

Commit 5d9bbbd

Browse files
authored
fix: correctly highlight text verbatim (#28)
* fix: correctly highlight text verbatim * fix: allow text verbatim to start with vertical line correctly handle following: ```jsonnet ||| | || ||| ||| ``` * fix: correctly parse end of text verbatim
1 parent a173f26 commit 5d9bbbd

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

language/jsonnet.tmLanguage.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"include": "#double-quoted-strings"
133133
},
134134
{
135-
"include": "#triple-quoted-strings"
135+
"include": "#block-text-verbatim"
136136
},
137137
{
138138
"include": "#builtin-functions"
@@ -232,12 +232,19 @@
232232
}
233233
]
234234
},
235-
"triple-quoted-strings": {
235+
"block-text-verbatim": {
236236
"patterns": [
237237
{
238-
"begin": "\\|\\|\\|",
239-
"end": "\\|\\|\\|",
240-
"name": "string.quoted.triple.jsonnet"
238+
"begin": "(?:\\|\\|\\|)(?:\\s*$)",
239+
"end": "^\\s*\\|\\|\\|",
240+
"name": "keyword.other.jsonnet",
241+
"patterns": [
242+
{
243+
"begin": "^([ \t]+)(?! |\t)",
244+
"end": "^(?!\\1|\\s*$)",
245+
"name": "string.unquoted.block.jsonnet"
246+
}
247+
]
241248
}
242249
]
243250
}

0 commit comments

Comments
 (0)