|
1 | | -filetype: markdown |
2 | | -detect: |
3 | | - filename: \.(livemd|md|mkd|mkdn|markdown)$ |
4 | | -rules: |
5 | | - # Tables (Github extension) |
6 | | - - type: ".*[ :]\\|[ :].*" |
7 | | - |
8 | | - # quotes |
9 | | - - statement: "^>.*" |
10 | | - |
11 | | - # Emphasis |
12 | | - - type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)" |
13 | | - |
14 | | - # Strong emphasis |
15 | | - - type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)" |
16 | | - |
17 | | - # strike-through |
18 | | - - type: "(^|[[:space:]])~~[^ ][^~]*~~" |
19 | | - |
20 | | - # horizontal rules |
21 | | - - special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$" |
22 | | - |
23 | | - # headlines |
24 | | - - special: "^#{1,6}.*" |
25 | | - |
26 | | - # lists |
27 | | - - identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. " |
28 | | - |
29 | | - # misc |
30 | | - - preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))" |
31 | | - |
32 | | - # links |
33 | | - - constant: "\\[[^]]+\\]" |
34 | | - - constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)" |
35 | | - |
36 | | - # images |
37 | | - - underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])" |
38 | | - |
39 | | - # urls |
40 | | - - underlined: "https?://[^ )>]+" |
41 | | - |
42 | | - - special: "^```$" |
43 | | - |
44 | | - # Fenced code blocks for syntax highlighting |
45 | | - - default: |
46 | | - start: "(?i)^```((c|h)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
47 | | - end: "^```$" |
48 | | - rules: |
49 | | - - include: "c" |
50 | | - - default: |
51 | | - start: "(?i)^```((cpp|c\\+\\+|cxx)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
52 | | - end: "^```$" |
53 | | - rules: |
54 | | - - include: "c++" |
55 | | - - default: |
56 | | - start: "(?i)^```((cs|csharp|c#)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
57 | | - end: "^```$" |
58 | | - rules: |
59 | | - - include: "csharp" |
60 | | - - default: |
61 | | - start: "(?i)^```((css|css.erb)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
62 | | - end: "^```$" |
63 | | - rules: |
64 | | - - include: "css" |
65 | | - - default: |
66 | | - start: "(?i)^```((patch|diff|rej)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
67 | | - end: "^```$" |
68 | | - rules: |
69 | | - - include: "patch" |
70 | | - - default: |
71 | | - start: "(?i)^```((go|golang)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
72 | | - end: "^```$" |
73 | | - rules: |
74 | | - - include: "go" |
75 | | - - default: |
76 | | - start: "(?i)^```((ini|conf)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
77 | | - end: "^```$" |
78 | | - rules: |
79 | | - - include: "ini" |
80 | | - - default: |
81 | | - start: "(?i)^```((java|bsh)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
82 | | - end: "^```$" |
83 | | - rules: |
84 | | - - include: "java" |
85 | | - - default: |
86 | | - start: "(?i)^```((js|jsx|javascript|es6|mjs|cjs|dataviewjs|\\{\\.js.+?\\})((\\\ |
87 | | - s+|:|,|\\{|\\?)[^`]*)?$)$" |
88 | | - end: "^```$" |
89 | | - rules: |
90 | | - - include: "javascript" |
91 | | - - default: |
92 | | - start: "(?i)^```((json|json5|sublime-settings|sublime-menu|sublime-keymap|sublime-mousemap|sublime-theme|sublime-build|sublime-project|sublime-completions)((\\\ |
93 | | - s+|:|,|\\{|\\?)[^`]*)?$)$" |
94 | | - end: "^```$" |
95 | | - rules: |
96 | | - - include: "json" |
97 | | - - default: |
98 | | - start: "(?i)^```((php|php3|php4|php5|phpt|phtml|aw|ctp)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
99 | | - end: "^```$" |
100 | | - rules: |
101 | | - - include: "php" |
102 | | - - default: |
103 | | - start: "(?i)^```((python|py|py3|rpy|pyw|cpy|SConstruct|Sconstruct|sconstruct|SConscript|gyp|gypi|\\\ |
104 | | - {\\.python.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
105 | | - end: "^```$" |
106 | | - rules: |
107 | | - - include: "python" |
108 | | - - default: |
109 | | - start: "(?i)^```((rust|rs|\\{\\.rust.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
110 | | - end: "^```$" |
111 | | - rules: |
112 | | - - include: "rust" |
113 | | - - default: |
114 | | - start: "(?i)^```((shell|sh|bash|zsh|bashrc|bash_profile|bash_login|profile|bash_logout|.textmate_init|\\\ |
115 | | - {\\.bash.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
116 | | - end: "^```$" |
117 | | - rules: |
118 | | - - include: "shell" |
119 | | - - default: |
120 | | - start: "(?i)^```((sql|ddl|dml)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
121 | | - end: "^```$" |
122 | | - rules: |
123 | | - - include: "sql" |
124 | | - - default: |
125 | | - start: "(?i)^```((typescript|ts)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
126 | | - end: "^```$" |
127 | | - rules: |
128 | | - - include: "typescript" |
129 | | - - default: |
130 | | - start: "(?i)^```((yaml|yml)((\\s+|:|,|\\{|\\?)[^`]*)?$)$" |
131 | | - end: "^```$" |
132 | | - rules: |
133 | | - - include: "yaml" |
134 | | - |
135 | | - - special: |
136 | | - start: "`" |
137 | | - end: "`" |
| 1 | +filetype: markdown |
| 2 | + |
| 3 | +detect: |
| 4 | + filename: \.(livemd|md|mkd|mkdn|markdown)$ |
| 5 | + |
| 6 | +rules: |
| 7 | + # tables (Github extension) |
| 8 | + - type: ".*[ :]\\|[ :].*" |
| 9 | + |
| 10 | + # quotes |
| 11 | + - statement: "^>.*" |
| 12 | + |
| 13 | + # emphasis |
| 14 | + - type: "(^|[[:space:]])(_[^ ][^_]*_|\\*[^ ][^*]*\\*)" |
| 15 | + |
| 16 | + # strong emphasis |
| 17 | + - type: "(^|[[:space:]])(__[^ ][^_]*__|\\*\\*[^ ][^*]*\\*\\*)" |
| 18 | + |
| 19 | + # strike-through |
| 20 | + - type: "(^|[[:space:]])~~[^ ][^~]*~~" |
| 21 | + |
| 22 | + # horizontal rules |
| 23 | + - special: "^(---+|===+|___+|\\*\\*\\*+)\\s*$" |
| 24 | + |
| 25 | + # headlines |
| 26 | + - special: "^#{1,6}.*" |
| 27 | + |
| 28 | + # lists |
| 29 | + - identifier: "^[[:space:]]*[\\*+-] |^[[:space:]]*[0-9]+\\. " |
| 30 | + |
| 31 | + # misc |
| 32 | + - preproc: "(\\(([CcRr]|[Tt][Mm])\\)|\\.{3}|(^|[[:space:]])\\-\\-($|[[:space:]]))" |
| 33 | + |
| 34 | + # links |
| 35 | + - constant: "\\[[^]]+\\]" |
| 36 | + - constant: "\\[([^][]|\\[[^]]*\\])*\\]\\([^)]+\\)" |
| 37 | + |
| 38 | + # images |
| 39 | + - underlined: "!\\[[^][]*\\](\\([^)]+\\)|\\[[^]]+\\])" |
| 40 | + |
| 41 | + # urls |
| 42 | + - underlined: "https?://[^ )>]+" |
| 43 | + |
| 44 | + - special: "^```$" |
| 45 | + |
| 46 | + # syntax highlighting of fenced code blocks |
| 47 | + - default: |
| 48 | + start: "(?i)^```(c|h)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 49 | + end: "^```$" |
| 50 | + rules: |
| 51 | + - include: "c" |
| 52 | + - default: |
| 53 | + start: "(?i)^```(cpp|c\\+\\+|cxx)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 54 | + end: "^```$" |
| 55 | + rules: |
| 56 | + - include: "c++" |
| 57 | + - default: |
| 58 | + start: "(?i)^```(cs|csharp|c#)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 59 | + end: "^```$" |
| 60 | + rules: |
| 61 | + - include: "csharp" |
| 62 | + - default: |
| 63 | + start: "(?i)^```(css|css.erb)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 64 | + end: "^```$" |
| 65 | + rules: |
| 66 | + - include: "css" |
| 67 | + - default: |
| 68 | + start: "(?i)^```(patch|diff|rej)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 69 | + end: "^```$" |
| 70 | + rules: |
| 71 | + - include: "patch" |
| 72 | + - default: |
| 73 | + start: "(?i)^```(go|golang)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 74 | + end: "^```$" |
| 75 | + rules: |
| 76 | + - include: "go" |
| 77 | + - default: |
| 78 | + start: "(?i)^```(ini|conf)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 79 | + end: "^```$" |
| 80 | + rules: |
| 81 | + - include: "ini" |
| 82 | + - default: |
| 83 | + start: "(?i)^```(java|bsh)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 84 | + end: "^```$" |
| 85 | + rules: |
| 86 | + - include: "java" |
| 87 | + - default: |
| 88 | + start: |
| 89 | + "(?i)^```(js|jsx|javascript|es6|mjs|cjs|dataviewjs|\\{\\.js.+?\\})((\\\ |
| 90 | + s+|:|,|\\{|\\?)[^`]*)?$" |
| 91 | + end: "^```$" |
| 92 | + rules: |
| 93 | + - include: "javascript" |
| 94 | + - default: |
| 95 | + start: |
| 96 | + "(?i)^```(json|json5|sublime-settings|sublime-menu|sublime-keymap|sublime-mousemap|sublime-theme|sublime-build|sublime-project|sublime-completions)((\\\ |
| 97 | + s+|:|,|\\{|\\?)[^`]*)?$" |
| 98 | + end: "^```$" |
| 99 | + rules: |
| 100 | + - include: "json" |
| 101 | + - default: |
| 102 | + start: "(?i)^```(php|php3|php4|php5|phpt|phtml|aw|ctp)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 103 | + end: "^```$" |
| 104 | + rules: |
| 105 | + - include: "php" |
| 106 | + - default: |
| 107 | + start: |
| 108 | + "(?i)^```(python|py|py3|rpy|pyw|cpy|SConstruct|Sconstruct|sconstruct|SConscript|gyp|gypi|\\\ |
| 109 | + {\\.python.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 110 | + end: "^```$" |
| 111 | + rules: |
| 112 | + - include: "python" |
| 113 | + - default: |
| 114 | + start: "(?i)^```(rust|rs|\\{\\.rust.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 115 | + end: "^```$" |
| 116 | + rules: |
| 117 | + - include: "rust" |
| 118 | + - default: |
| 119 | + start: |
| 120 | + "(?i)^```(shell|sh|bash|zsh|bashrc|bash_profile|bash_login|profile|bash_logout|.textmate_init|\\\ |
| 121 | + {\\.bash.+?\\})((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 122 | + end: "^```$" |
| 123 | + rules: |
| 124 | + - include: "shell" |
| 125 | + - default: |
| 126 | + start: "(?i)^```(sql|ddl|dml)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 127 | + end: "^```$" |
| 128 | + rules: |
| 129 | + - include: "sql" |
| 130 | + - default: |
| 131 | + start: "(?i)^```(typescript|ts)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 132 | + end: "^```$" |
| 133 | + rules: |
| 134 | + - include: "typescript" |
| 135 | + - default: |
| 136 | + start: "(?i)^```(yaml|yml)((\\s+|:|,|\\{|\\?)[^`]*)?$" |
| 137 | + end: "^```$" |
| 138 | + rules: |
| 139 | + - include: "yaml" |
| 140 | + |
| 141 | + - special: |
| 142 | + start: "`" |
| 143 | + end: "`" |
0 commit comments