-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsubtitles.tmLanguage.json
64 lines (64 loc) · 1.67 KB
/
subtitles.tmLanguage.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Subtitles",
"patterns": [
{ "include": "#number" },
{ "include": "#timeline" },
{ "include": "#html" },
{ "include": "#bb" }
],
"repository": {
"number": {
"patterns": [{
"name": "constant.numeric",
"match": "^([+\\-]?\\d+)(?=\\s|$)"
}]
},
"keyword": {
"patterns": [{
"name": "constant.numeric",
"match": "^\\s*(WEBVTT|NOTE|STYLE)(?=\\s|$)"
}]
},
"timeline": {
"patterns": [{
"match": "^\\s*([+\\-]?(?:\\d+:)?\\d+:\\d{2}(?:[,.]\\d+)?)\\s*(-->|,)\\s*([+\\-]?(?:\\d+:)?\\d+:\\d{2}(?:[,.]\\d+)?)\\s*(.*?)\\s*$",
"captures": {
"1": { "name": "variable.parameter" },
"2": { "name": "keyword.control" },
"3": { "name": "variable.parameter" },
"4": { "name": "constant.numeric" }
}
}]
},
"html": {
"patterns": [{
"begin": "(</?)(.*?)( .*?)?(?=\\>)",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.inline.any.html" },
"3": { "name": "entity.other.attribute-name.html" }
},
"end": "(/?>)",
"endCaptures": {
"1": { "name": "punctuation.definition.tag.end.html" }
}
}]
},
"bb": {
"patterns": [{
"begin": "(\\[(?:END\\s)?)(.*?)(?=\\])",
"beginCaptures": {
"1": { "name": "punctuation.definition.tag.begin.html" },
"2": { "name": "entity.name.tag.inline.any.html" },
"3": { "name": "entity.other.attribute-name.html" }
},
"end": "(\\])",
"endCaptures": {
"1": { "name": "punctuation.definition.tag.end.html" }
}
}]
}
},
"scopeName": "source.subtitles"
}