@kernelift/markdown 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,229 +0,0 @@
1
- var e = {
2
- comments: {
3
- blockComment: ["<!--", "-->"]
4
- },
5
- brackets: [
6
- ["{", "}"],
7
- ["[", "]"],
8
- ["(", ")"]
9
- ],
10
- autoClosingPairs: [
11
- { open: "{", close: "}" },
12
- { open: "[", close: "]" },
13
- { open: "(", close: ")" },
14
- { open: "<", close: ">", notIn: ["string"] }
15
- ],
16
- surroundingPairs: [
17
- { open: "(", close: ")" },
18
- { open: "[", close: "]" },
19
- { open: "`", close: "`" }
20
- ],
21
- folding: {
22
- markers: {
23
- start: new RegExp("^\\s*<!--\\s*#?region\\b.*-->"),
24
- end: new RegExp("^\\s*<!--\\s*#?endregion\\b.*-->")
25
- }
26
- }
27
- }, t = {
28
- defaultToken: "",
29
- tokenPostfix: ".md",
30
- // escape codes
31
- control: /[\\`*_\[\]{}()#+\-\.!]/,
32
- noncontrol: /[^\\`*_\[\]{}()#+\-\.!]/,
33
- escapes: /\\(?:@control)/,
34
- // escape codes for javascript/CSS strings
35
- jsescapes: /\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,
36
- // non matched elements
37
- empty: [
38
- "area",
39
- "base",
40
- "basefont",
41
- "br",
42
- "col",
43
- "frame",
44
- "hr",
45
- "img",
46
- "input",
47
- "isindex",
48
- "link",
49
- "meta",
50
- "param"
51
- ],
52
- tokenizer: {
53
- root: [
54
- // markdown tables
55
- [/^\s*\|/, "@rematch", "@table_header"],
56
- // headers (with #)
57
- [/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/, ["white", "keyword", "keyword", "keyword"]],
58
- // headers (with =)
59
- [/^\s*(=+|\-+)\s*$/, "keyword"],
60
- // headers (with ***)
61
- [/^\s*((\*[ ]?)+)\s*$/, "meta.separator"],
62
- // quote
63
- [/^\s*>+/, "comment"],
64
- // list (starting with * or number)
65
- [/^\s*([\*\-+:]|\d+\.)\s/, "keyword"],
66
- // code block (4 spaces indent)
67
- [/^(\t|[ ]{4})[^ ].*$/, "string"],
68
- // code block (3 tilde)
69
- [/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/, { token: "string", next: "@codeblock" }],
70
- // github style code blocks (with backticks and language)
71
- [
72
- /^\s*```\s*((?:\w|[\/\-#])+).*$/,
73
- { token: "string", next: "@codeblockgh", nextEmbedded: "$1" }
74
- ],
75
- // github style code blocks (with backticks but no language)
76
- [/^\s*```\s*$/, { token: "string", next: "@codeblock" }],
77
- // markup within lines
78
- { include: "@linecontent" }
79
- ],
80
- table_header: [
81
- { include: "@table_common" },
82
- [/[^\|]+/, "keyword.table.header"]
83
- // table header
84
- ],
85
- table_body: [{ include: "@table_common" }, { include: "@linecontent" }],
86
- table_common: [
87
- [/\s*[\-:]+\s*/, { token: "keyword", switchTo: "table_body" }],
88
- // header-divider
89
- [/^\s*\|/, "keyword.table.left"],
90
- // opening |
91
- [/^\s*[^\|]/, "@rematch", "@pop"],
92
- // exiting
93
- [/^\s*$/, "@rematch", "@pop"],
94
- // exiting
95
- [
96
- /\|/,
97
- {
98
- cases: {
99
- "@eos": "keyword.table.right",
100
- // closing |
101
- "@default": "keyword.table.middle"
102
- // inner |
103
- }
104
- }
105
- ]
106
- ],
107
- codeblock: [
108
- [/^\s*~~~\s*$/, { token: "string", next: "@pop" }],
109
- [/^\s*```\s*$/, { token: "string", next: "@pop" }],
110
- [/.*$/, "variable.source"]
111
- ],
112
- // github style code blocks
113
- codeblockgh: [
114
- [/```\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
115
- [/[^`]+/, "variable.source"]
116
- ],
117
- linecontent: [
118
- // escapes
119
- [/&\w+;/, "string.escape"],
120
- [/@escapes/, "escape"],
121
- // various markup
122
- [/\b__([^\\_]|@escapes|_(?!_))+__\b/, "strong"],
123
- [/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/, "strong"],
124
- [/\b_[^_]+_\b/, "emphasis"],
125
- [/\*([^\\*]|@escapes)+\*/, "emphasis"],
126
- [/`([^\\`]|@escapes)+`/, "variable"],
127
- // links
128
- [/\{+[^}]+\}+/, "string.target"],
129
- [/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/, ["string.link", "", "string.link"]],
130
- [/(!?\[)((?:[^\]\\]|@escapes)*)(\])/, "string.link"],
131
- // or html
132
- { include: "html" }
133
- ],
134
- // Note: it is tempting to rather switch to the real HTML mode instead of building our own here
135
- // but currently there is a limitation in Monarch that prevents us from doing it: The opening
136
- // '<' would start the HTML mode, however there is no way to jump 1 character back to let the
137
- // HTML mode also tokenize the opening angle bracket. Thus, even though we could jump to HTML,
138
- // we cannot correctly tokenize it in that mode yet.
139
- html: [
140
- // html tags
141
- [/<(\w+)\/>/, "tag"],
142
- [
143
- /<(\w+)(\-|\w)*/,
144
- {
145
- cases: {
146
- "@empty": { token: "tag", next: "@tag.$1" },
147
- "@default": { token: "tag", next: "@tag.$1" }
148
- }
149
- }
150
- ],
151
- [/<\/(\w+)(\-|\w)*\s*>/, { token: "tag" }],
152
- [/<!--/, "comment", "@comment"]
153
- ],
154
- comment: [
155
- [/[^<\-]+/, "comment.content"],
156
- [/-->/, "comment", "@pop"],
157
- [/<!--/, "comment.content.invalid"],
158
- [/[<\-]/, "comment.content"]
159
- ],
160
- // Almost full HTML tag matching, complete with embedded scripts & styles
161
- tag: [
162
- [/[ \t\r\n]+/, "white"],
163
- [
164
- /(type)(\s*=\s*)(")([^"]+)(")/,
165
- [
166
- "attribute.name.html",
167
- "delimiter.html",
168
- "string.html",
169
- { token: "string.html", switchTo: "@tag.$S2.$4" },
170
- "string.html"
171
- ]
172
- ],
173
- [
174
- /(type)(\s*=\s*)(')([^']+)(')/,
175
- [
176
- "attribute.name.html",
177
- "delimiter.html",
178
- "string.html",
179
- { token: "string.html", switchTo: "@tag.$S2.$4" },
180
- "string.html"
181
- ]
182
- ],
183
- [/(\w+)(\s*=\s*)("[^"]*"|'[^']*')/, ["attribute.name.html", "delimiter.html", "string.html"]],
184
- [/\w+/, "attribute.name.html"],
185
- [/\/>/, "tag", "@pop"],
186
- [
187
- />/,
188
- {
189
- cases: {
190
- "$S2==style": {
191
- token: "tag",
192
- switchTo: "embeddedStyle",
193
- nextEmbedded: "text/css"
194
- },
195
- "$S2==script": {
196
- cases: {
197
- $S3: {
198
- token: "tag",
199
- switchTo: "embeddedScript",
200
- nextEmbedded: "$S3"
201
- },
202
- "@default": {
203
- token: "tag",
204
- switchTo: "embeddedScript",
205
- nextEmbedded: "text/javascript"
206
- }
207
- }
208
- },
209
- "@default": { token: "tag", next: "@pop" }
210
- }
211
- }
212
- ]
213
- ],
214
- embeddedStyle: [
215
- [/[^<]+/, ""],
216
- [/<\/style\s*>/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
217
- [/</, ""]
218
- ],
219
- embeddedScript: [
220
- [/[^<]+/, ""],
221
- [/<\/script\s*>/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
222
- [/</, ""]
223
- ]
224
- }
225
- };
226
- export {
227
- e as conf,
228
- t as language
229
- };