-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHTML (Rml).sublime-syntax
110 lines (102 loc) · 3.99 KB
/
HTML (Rml).sublime-syntax
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
%YAML 1.2
---
name: HTML (Rml)
file_extensions:
- rml
scope: embedding.rml
extends: Packages/HTML/HTML.sublime-syntax
version: 2
contexts:
script-lua-content:
- meta_include_prototype: false
- match: '{{script_content_begin}}'
captures:
1: comment.block.rml punctuation.definition.common.begin.rml
pop: 1
embed: scope:source.lua
embed_scope: source.lua.embedded.html
escape: '{{script_content_end}}'
escape_captures:
1: source.lua.embedded.html
2: comment.block.html punctuation.definition.comment.end.html
3: source.lua.embedded.html
4: comment.block.html punctuation.definition.comment.end.html
# Overwritten to support <rml>
tag-html:
- meta_prepend: true
- match: (</?)((?i:rml){{tag_name_break}})
captures:
1: punctuation.definition.tag.begin.html
2: entity.name.tag.structure.any.rml
push:
- meta_scope: meta.tag.structure.any.html
- include: tag-end
- include: tag-attributes
# Overwritten to call script-lua-content to embed source.lua.
script-javascript:
- meta_scope: meta.tag.script.begin.html
- include: script-common
- match: '>'
scope: punctuation.definition.tag.end.html
set: script-lua-content
# Overwritten to embed source.lua.
tag-event-attribute-value:
- match: \"
scope: meta.string.html string.quoted.double.html punctuation.definition.string.begin.html
embed: scope:source.lua
embed_scope: meta.string.html meta.interpolation.html source.lua.embedded.html
escape: \"
escape_captures:
0: meta.string.html string.quoted.double.html punctuation.definition.string.end.html
- match: \'
scope: meta.string.html string.quoted.single.html punctuation.definition.string.begin.html
embed: scope:source.lua
embed_scope: meta.string.html meta.interpolation.html source.lua.embedded.html
escape: \'
escape_captures:
0: meta.string.html string.quoted.single.html punctuation.definition.string.end.html
- include: else-pop
# Overwritten to embed embedding.rcss.
style-css-content:
- meta_include_prototype: false
- match: \s*((<!\[)(CDATA)(\[))
captures:
1: meta.tag.sgml.cdata.html
2: punctuation.definition.tag.begin.html
3: keyword.declaration.cdata.html
4: punctuation.definition.tag.begin.html
pop: 1 # make sure to match only once
embed: scope:embedding.rcss
embed_scope: meta.tag.sgml.cdata.html source.rcss.embedded.html
escape: \]\]>
escape_captures:
0: meta.tag.sgml.cdata.html punctuation.definition.tag.end.html
- match: '{{style_content_begin}}'
captures:
1: comment.block.html punctuation.definition.comment.begin.html
pop: 1 # make sure to match only once
embed: scope:embedding.rcss
embed_scope: source.rcss.embedded.html
escape: '{{style_content_end}}'
escape_captures:
1: source.rcss.embedded.html
2: comment.block.html punctuation.definition.comment.end.html
3: source.rcss.embedded.html
4: comment.block.html punctuation.definition.comment.end.html
# Overwritten to embed embedding.rcss.
tag-style-attribute-value:
- match: \"
scope: meta.string.html string.quoted.double.html punctuation.definition.string.begin.html
embed: scope:embedding.rcss#rule-list-body
embed_scope: meta.string.html meta.interpolation.html source.rcss.embedded.html
escape: \"
escape_captures:
0: meta.string.html string.quoted.double.html punctuation.definition.string.end.html
- match: \'
scope: meta.string.html string.quoted.single.html punctuation.definition.string.begin.html
embed: scope:embedding.rcss#rule-list-body
embed_scope: meta.string.html meta.interpolation.html source.rcss.embedded.html
escape: \'
escape_captures:
0: meta.string.html string.quoted.single.html punctuation.definition.string.end.html
- include: else-pop