@lotte-innovate/ui-component-test 0.0.108 → 0.0.110

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. package/dist/lib/components/Avatar/index.js +1 -1
  2. package/dist/lib/components/ContextMenu/ContextMenuItem.js +1 -1
  3. package/dist/lib/components/ContextMenu/ContextMenuSeparator.js +1 -1
  4. package/dist/lib/components/ContextMenu/ContextMenuSeparator.mjs +1 -1
  5. package/dist/lib/components/ContextMenu/ContextMenuSeparator.mjs.map +1 -1
  6. package/dist/lib/components/ContextMenu/ContextMenuTrigger.js +1 -1
  7. package/dist/lib/components/ContextMenu/ContextMenuTrigger.mjs +1 -1
  8. package/dist/lib/components/ContextMenu/ContextMenuTrigger.mjs.map +1 -1
  9. package/dist/lib/components/DropdownMenu/DropdownMenuItem.js +1 -1
  10. package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.js +1 -1
  11. package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.mjs +1 -1
  12. package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.mjs.map +1 -1
  13. package/dist/lib/components/Editor/index.js +1 -1
  14. package/dist/lib/components/Editor/index.mjs +1 -1
  15. package/dist/lib/components/HoverCard/HoverCardContent.js +1 -1
  16. package/dist/lib/components/IconButton/index.js +1 -1
  17. package/dist/lib/components/Menubar/MenubarItem.js +1 -1
  18. package/dist/lib/components/Menubar/MenubarSeparator.js +1 -1
  19. package/dist/lib/components/Menubar/MenubarSeparator.mjs +1 -1
  20. package/dist/lib/components/Menubar/MenubarSeparator.mjs.map +1 -1
  21. package/dist/lib/tsconfig.tsbuildinfo +1 -1
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +1 -2
  24. package/dist/public/tinymce/icons/default/icons.d.ts +0 -0
  25. package/dist/public/tinymce/icons/default/icons.js +0 -195
  26. package/dist/public/tinymce/icons/default/index.d.ts +0 -1
  27. package/dist/public/tinymce/icons/default/index.js +0 -8
  28. package/dist/public/tinymce/models/dom/index.d.ts +0 -1
  29. package/dist/public/tinymce/models/dom/index.js +0 -8
  30. package/dist/public/tinymce/models/dom/model.d.ts +0 -0
  31. package/dist/public/tinymce/models/dom/model.js +0 -7988
  32. package/dist/public/tinymce/plugins/advlist/index.d.ts +0 -1
  33. package/dist/public/tinymce/plugins/advlist/index.js +0 -8
  34. package/dist/public/tinymce/plugins/advlist/plugin.d.ts +0 -0
  35. package/dist/public/tinymce/plugins/advlist/plugin.js +0 -255
  36. package/dist/public/tinymce/plugins/autolink/index.d.ts +0 -1
  37. package/dist/public/tinymce/plugins/autolink/index.js +0 -8
  38. package/dist/public/tinymce/plugins/autolink/plugin.d.ts +0 -0
  39. package/dist/public/tinymce/plugins/autolink/plugin.js +0 -221
  40. package/dist/public/tinymce/plugins/code/index.d.ts +0 -1
  41. package/dist/public/tinymce/plugins/code/index.js +0 -8
  42. package/dist/public/tinymce/plugins/code/plugin.d.ts +0 -0
  43. package/dist/public/tinymce/plugins/code/plugin.js +0 -77
  44. package/dist/public/tinymce/plugins/codesample/index.d.ts +0 -1
  45. package/dist/public/tinymce/plugins/codesample/index.js +0 -8
  46. package/dist/public/tinymce/plugins/codesample/plugin.d.ts +0 -45
  47. package/dist/public/tinymce/plugins/codesample/plugin.js +0 -2462
  48. package/dist/public/tinymce/plugins/image/index.d.ts +0 -1
  49. package/dist/public/tinymce/plugins/image/index.js +0 -8
  50. package/dist/public/tinymce/plugins/image/plugin.d.ts +0 -0
  51. package/dist/public/tinymce/plugins/image/plugin.js +0 -1523
  52. package/dist/public/tinymce/plugins/link/index.d.ts +0 -1
  53. package/dist/public/tinymce/plugins/link/index.js +0 -8
  54. package/dist/public/tinymce/plugins/link/plugin.d.ts +0 -0
  55. package/dist/public/tinymce/plugins/link/plugin.js +0 -1246
  56. package/dist/public/tinymce/plugins/lists/index.d.ts +0 -1
  57. package/dist/public/tinymce/plugins/lists/index.js +0 -8
  58. package/dist/public/tinymce/plugins/lists/plugin.d.ts +0 -0
  59. package/dist/public/tinymce/plugins/lists/plugin.js +0 -2191
  60. package/dist/public/tinymce/plugins/table/index.d.ts +0 -1
  61. package/dist/public/tinymce/plugins/table/index.js +0 -8
  62. package/dist/public/tinymce/plugins/table/plugin.d.ts +0 -0
  63. package/dist/public/tinymce/plugins/table/plugin.js +0 -3399
  64. package/dist/public/tinymce/skins/content/default/content.d.ts +0 -0
  65. package/dist/public/tinymce/skins/content/default/content.js +0 -3
  66. package/dist/public/tinymce/skins/ui/oxide/content.d.ts +0 -0
  67. package/dist/public/tinymce/skins/ui/oxide/content.inline.d.ts +0 -0
  68. package/dist/public/tinymce/skins/ui/oxide/content.inline.js +0 -3
  69. package/dist/public/tinymce/skins/ui/oxide/content.js +0 -3
  70. package/dist/public/tinymce/skins/ui/oxide/skin.d.ts +0 -0
  71. package/dist/public/tinymce/skins/ui/oxide/skin.js +0 -3
  72. package/dist/public/tinymce/skins/ui/oxide/skin.shadowdom.d.ts +0 -0
  73. package/dist/public/tinymce/skins/ui/oxide/skin.shadowdom.js +0 -3
  74. package/dist/public/tinymce/skins/ui/oxide-dark/content.d.ts +0 -0
  75. package/dist/public/tinymce/skins/ui/oxide-dark/content.inline.d.ts +0 -0
  76. package/dist/public/tinymce/skins/ui/oxide-dark/content.inline.js +0 -3
  77. package/dist/public/tinymce/skins/ui/oxide-dark/content.js +0 -3
  78. package/dist/public/tinymce/skins/ui/oxide-dark/skin.d.ts +0 -0
  79. package/dist/public/tinymce/skins/ui/oxide-dark/skin.js +0 -3
  80. package/dist/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.d.ts +0 -0
  81. package/dist/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +0 -3
  82. package/dist/public/tinymce/themes/silver/index.d.ts +0 -1
  83. package/dist/public/tinymce/themes/silver/index.js +0 -8
  84. package/dist/public/tinymce/themes/silver/theme.d.ts +0 -0
  85. package/dist/public/tinymce/themes/silver/theme.js +0 -29731
  86. package/dist/public/tinymce/tinymce.d.ts +0 -1
  87. package/dist/public/tinymce/tinymce.js +0 -31974
  88. package/public/tinymce/CHANGELOG.md +0 -3453
  89. package/public/tinymce/README.md +0 -73
  90. package/public/tinymce/bower.json +0 -27
  91. package/public/tinymce/composer.json +0 -52
  92. package/public/tinymce/icons/default/icons.js +0 -194
  93. package/public/tinymce/icons/default/icons.min.js +0 -1
  94. package/public/tinymce/icons/default/index.js +0 -7
  95. package/public/tinymce/license.txt +0 -21
  96. package/public/tinymce/models/dom/index.js +0 -7
  97. package/public/tinymce/models/dom/model.js +0 -8040
  98. package/public/tinymce/models/dom/model.min.js +0 -4
  99. package/public/tinymce/package.json +0 -32
  100. package/public/tinymce/plugins/advlist/index.js +0 -7
  101. package/public/tinymce/plugins/advlist/plugin.js +0 -259
  102. package/public/tinymce/plugins/advlist/plugin.min.js +0 -4
  103. package/public/tinymce/plugins/autolink/index.js +0 -7
  104. package/public/tinymce/plugins/autolink/plugin.js +0 -228
  105. package/public/tinymce/plugins/autolink/plugin.min.js +0 -4
  106. package/public/tinymce/plugins/code/index.js +0 -7
  107. package/public/tinymce/plugins/code/plugin.js +0 -85
  108. package/public/tinymce/plugins/code/plugin.min.js +0 -4
  109. package/public/tinymce/plugins/codesample/index.js +0 -7
  110. package/public/tinymce/plugins/codesample/plugin.js +0 -2463
  111. package/public/tinymce/plugins/codesample/plugin.min.js +0 -4
  112. package/public/tinymce/plugins/image/index.js +0 -7
  113. package/public/tinymce/plugins/image/plugin.js +0 -1505
  114. package/public/tinymce/plugins/image/plugin.min.js +0 -4
  115. package/public/tinymce/plugins/link/index.js +0 -7
  116. package/public/tinymce/plugins/link/plugin.js +0 -1242
  117. package/public/tinymce/plugins/link/plugin.min.js +0 -4
  118. package/public/tinymce/plugins/lists/index.js +0 -7
  119. package/public/tinymce/plugins/lists/plugin.js +0 -2172
  120. package/public/tinymce/plugins/lists/plugin.min.js +0 -4
  121. package/public/tinymce/plugins/table/index.js +0 -7
  122. package/public/tinymce/plugins/table/plugin.js +0 -3462
  123. package/public/tinymce/plugins/table/plugin.min.js +0 -4
  124. package/public/tinymce/skins/content/default/content.css +0 -61
  125. package/public/tinymce/skins/content/default/content.js +0 -2
  126. package/public/tinymce/skins/content/default/content.min.css +0 -1
  127. package/public/tinymce/skins/ui/oxide/content.css +0 -785
  128. package/public/tinymce/skins/ui/oxide/content.inline.css +0 -779
  129. package/public/tinymce/skins/ui/oxide/content.inline.js +0 -2
  130. package/public/tinymce/skins/ui/oxide/content.inline.min.css +0 -1
  131. package/public/tinymce/skins/ui/oxide/content.js +0 -2
  132. package/public/tinymce/skins/ui/oxide/content.min.css +0 -1
  133. package/public/tinymce/skins/ui/oxide/skin.css +0 -3763
  134. package/public/tinymce/skins/ui/oxide/skin.js +0 -2
  135. package/public/tinymce/skins/ui/oxide/skin.min.css +0 -1
  136. package/public/tinymce/skins/ui/oxide/skin.shadowdom.css +0 -30
  137. package/public/tinymce/skins/ui/oxide/skin.shadowdom.js +0 -2
  138. package/public/tinymce/skins/ui/oxide/skin.shadowdom.min.css +0 -1
  139. package/public/tinymce/skins/ui/oxide-dark/content.css +0 -766
  140. package/public/tinymce/skins/ui/oxide-dark/content.inline.css +0 -779
  141. package/public/tinymce/skins/ui/oxide-dark/content.inline.js +0 -2
  142. package/public/tinymce/skins/ui/oxide-dark/content.inline.min.css +0 -1
  143. package/public/tinymce/skins/ui/oxide-dark/content.js +0 -2
  144. package/public/tinymce/skins/ui/oxide-dark/content.min.css +0 -1
  145. package/public/tinymce/skins/ui/oxide-dark/skin.css +0 -3766
  146. package/public/tinymce/skins/ui/oxide-dark/skin.js +0 -2
  147. package/public/tinymce/skins/ui/oxide-dark/skin.min.css +0 -1
  148. package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +0 -30
  149. package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +0 -2
  150. package/public/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +0 -1
  151. package/public/tinymce/themes/silver/index.js +0 -7
  152. package/public/tinymce/themes/silver/theme.js +0 -30775
  153. package/public/tinymce/themes/silver/theme.min.js +0 -384
  154. package/public/tinymce/tinymce.d.ts +0 -3238
  155. package/public/tinymce/tinymce.js +0 -31779
  156. package/public/tinymce/tinymce.min.js +0 -384
@@ -1,2462 +0,0 @@
1
- "use strict";
2
- /**
3
- * TinyMCE version 6.8.5 (TBD)
4
- */
5
- (function () {
6
- 'use strict';
7
- var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
8
- var isNullable = function (a) { return a === null || a === undefined; };
9
- var isNonNullable = function (a) { return !isNullable(a); };
10
- var noop = function () {
11
- };
12
- var constant = function (value) {
13
- return function () {
14
- return value;
15
- };
16
- };
17
- var Optional = /** @class */ (function () {
18
- function Optional(tag, value) {
19
- this.tag = tag;
20
- this.value = value;
21
- }
22
- Optional.some = function (value) {
23
- return new Optional(true, value);
24
- };
25
- Optional.none = function () {
26
- return Optional.singletonNone;
27
- };
28
- Optional.prototype.fold = function (onNone, onSome) {
29
- if (this.tag) {
30
- return onSome(this.value);
31
- }
32
- else {
33
- return onNone();
34
- }
35
- };
36
- Optional.prototype.isSome = function () {
37
- return this.tag;
38
- };
39
- Optional.prototype.isNone = function () {
40
- return !this.tag;
41
- };
42
- Optional.prototype.map = function (mapper) {
43
- if (this.tag) {
44
- return Optional.some(mapper(this.value));
45
- }
46
- else {
47
- return Optional.none();
48
- }
49
- };
50
- Optional.prototype.bind = function (binder) {
51
- if (this.tag) {
52
- return binder(this.value);
53
- }
54
- else {
55
- return Optional.none();
56
- }
57
- };
58
- Optional.prototype.exists = function (predicate) {
59
- return this.tag && predicate(this.value);
60
- };
61
- Optional.prototype.forall = function (predicate) {
62
- return !this.tag || predicate(this.value);
63
- };
64
- Optional.prototype.filter = function (predicate) {
65
- if (!this.tag || predicate(this.value)) {
66
- return this;
67
- }
68
- else {
69
- return Optional.none();
70
- }
71
- };
72
- Optional.prototype.getOr = function (replacement) {
73
- return this.tag ? this.value : replacement;
74
- };
75
- Optional.prototype.or = function (replacement) {
76
- return this.tag ? this : replacement;
77
- };
78
- Optional.prototype.getOrThunk = function (thunk) {
79
- return this.tag ? this.value : thunk();
80
- };
81
- Optional.prototype.orThunk = function (thunk) {
82
- return this.tag ? this : thunk();
83
- };
84
- Optional.prototype.getOrDie = function (message) {
85
- if (!this.tag) {
86
- throw new Error(message !== null && message !== void 0 ? message : 'Called getOrDie on None');
87
- }
88
- else {
89
- return this.value;
90
- }
91
- };
92
- Optional.from = function (value) {
93
- return isNonNullable(value) ? Optional.some(value) : Optional.none();
94
- };
95
- Optional.prototype.getOrNull = function () {
96
- return this.tag ? this.value : null;
97
- };
98
- Optional.prototype.getOrUndefined = function () {
99
- return this.value;
100
- };
101
- Optional.prototype.each = function (worker) {
102
- if (this.tag) {
103
- worker(this.value);
104
- }
105
- };
106
- Optional.prototype.toArray = function () {
107
- return this.tag ? [this.value] : [];
108
- };
109
- Optional.prototype.toString = function () {
110
- return this.tag ? "some(".concat(this.value, ")") : 'none()';
111
- };
112
- return Optional;
113
- }());
114
- Optional.singletonNone = new Optional(false);
115
- var get$1 = function (xs, i) { return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none(); };
116
- var head = function (xs) { return get$1(xs, 0); };
117
- var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
118
- var Global = typeof window !== 'undefined' ? window : Function('return this;')();
119
- var prismjs = function (global, module, exports) {
120
- var oldprism = window.Prism;
121
- window.Prism = { manual: true };
122
- var _self = typeof window !== 'undefined' ? window : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : {};
123
- var Prism = function (_self) {
124
- var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
125
- var uniqueId = 0;
126
- var plainTextGrammar = {};
127
- var _ = {
128
- manual: _self.Prism && _self.Prism.manual,
129
- disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
130
- util: {
131
- encode: function encode(tokens) {
132
- if (tokens instanceof Token) {
133
- return new Token(tokens.type, encode(tokens.content), tokens.alias);
134
- }
135
- else if (Array.isArray(tokens)) {
136
- return tokens.map(encode);
137
- }
138
- else {
139
- return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
140
- }
141
- },
142
- type: function (o) {
143
- return Object.prototype.toString.call(o).slice(8, -1);
144
- },
145
- objId: function (obj) {
146
- if (!obj['__id']) {
147
- Object.defineProperty(obj, '__id', { value: ++uniqueId });
148
- }
149
- return obj['__id'];
150
- },
151
- clone: function deepClone(o, visited) {
152
- visited = visited || {};
153
- var clone;
154
- var id;
155
- switch (_.util.type(o)) {
156
- case 'Object':
157
- id = _.util.objId(o);
158
- if (visited[id]) {
159
- return visited[id];
160
- }
161
- clone = {};
162
- visited[id] = clone;
163
- for (var key in o) {
164
- if (o.hasOwnProperty(key)) {
165
- clone[key] = deepClone(o[key], visited);
166
- }
167
- }
168
- return clone;
169
- case 'Array':
170
- id = _.util.objId(o);
171
- if (visited[id]) {
172
- return visited[id];
173
- }
174
- clone = [];
175
- visited[id] = clone;
176
- o.forEach(function (v, i) {
177
- clone[i] = deepClone(v, visited);
178
- });
179
- return clone;
180
- default:
181
- return o;
182
- }
183
- },
184
- getLanguage: function (element) {
185
- while (element) {
186
- var m = lang.exec(element.className);
187
- if (m) {
188
- return m[1].toLowerCase();
189
- }
190
- element = element.parentElement;
191
- }
192
- return 'none';
193
- },
194
- setLanguage: function (element, language) {
195
- element.className = element.className.replace(RegExp(lang, 'gi'), '');
196
- element.classList.add('language-' + language);
197
- },
198
- currentScript: function () {
199
- if (typeof document === 'undefined') {
200
- return null;
201
- }
202
- if ('currentScript' in document && 1 < 2) {
203
- return document.currentScript;
204
- }
205
- try {
206
- throw new Error();
207
- }
208
- catch (err) {
209
- var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
210
- if (src) {
211
- var scripts = document.getElementsByTagName('script');
212
- for (var i in scripts) {
213
- if (scripts[i].src == src) {
214
- return scripts[i];
215
- }
216
- }
217
- }
218
- return null;
219
- }
220
- },
221
- isActive: function (element, className, defaultActivation) {
222
- var no = 'no-' + className;
223
- while (element) {
224
- var classList = element.classList;
225
- if (classList.contains(className)) {
226
- return true;
227
- }
228
- if (classList.contains(no)) {
229
- return false;
230
- }
231
- element = element.parentElement;
232
- }
233
- return !!defaultActivation;
234
- }
235
- },
236
- languages: {
237
- plain: plainTextGrammar,
238
- plaintext: plainTextGrammar,
239
- text: plainTextGrammar,
240
- txt: plainTextGrammar,
241
- extend: function (id, redef) {
242
- var lang = _.util.clone(_.languages[id]);
243
- for (var key in redef) {
244
- lang[key] = redef[key];
245
- }
246
- return lang;
247
- },
248
- insertBefore: function (inside, before, insert, root) {
249
- root = root || _.languages;
250
- var grammar = root[inside];
251
- var ret = {};
252
- for (var token in grammar) {
253
- if (grammar.hasOwnProperty(token)) {
254
- if (token == before) {
255
- for (var newToken in insert) {
256
- if (insert.hasOwnProperty(newToken)) {
257
- ret[newToken] = insert[newToken];
258
- }
259
- }
260
- }
261
- if (!insert.hasOwnProperty(token)) {
262
- ret[token] = grammar[token];
263
- }
264
- }
265
- }
266
- var old = root[inside];
267
- root[inside] = ret;
268
- _.languages.DFS(_.languages, function (key, value) {
269
- if (value === old && key != inside) {
270
- this[key] = ret;
271
- }
272
- });
273
- return ret;
274
- },
275
- DFS: function DFS(o, callback, type, visited) {
276
- visited = visited || {};
277
- var objId = _.util.objId;
278
- for (var i in o) {
279
- if (o.hasOwnProperty(i)) {
280
- callback.call(o, i, o[i], type || i);
281
- var property = o[i];
282
- var propertyType = _.util.type(property);
283
- if (propertyType === 'Object' && !visited[objId(property)]) {
284
- visited[objId(property)] = true;
285
- DFS(property, callback, null, visited);
286
- }
287
- else if (propertyType === 'Array' && !visited[objId(property)]) {
288
- visited[objId(property)] = true;
289
- DFS(property, callback, i, visited);
290
- }
291
- }
292
- }
293
- }
294
- },
295
- plugins: {},
296
- highlightAll: function (async, callback) {
297
- _.highlightAllUnder(document, async, callback);
298
- },
299
- highlightAllUnder: function (container, async, callback) {
300
- var env = {
301
- callback: callback,
302
- container: container,
303
- selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
304
- };
305
- _.hooks.run('before-highlightall', env);
306
- env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
307
- _.hooks.run('before-all-elements-highlight', env);
308
- for (var i = 0, element; element = env.elements[i++];) {
309
- _.highlightElement(element, async === true, env.callback);
310
- }
311
- },
312
- highlightElement: function (element, async, callback) {
313
- var language = _.util.getLanguage(element);
314
- var grammar = _.languages[language];
315
- _.util.setLanguage(element, language);
316
- var parent = element.parentElement;
317
- if (parent && parent.nodeName.toLowerCase() === 'pre') {
318
- _.util.setLanguage(parent, language);
319
- }
320
- var code = element.textContent;
321
- var env = {
322
- element: element,
323
- language: language,
324
- grammar: grammar,
325
- code: code
326
- };
327
- function insertHighlightedCode(highlightedCode) {
328
- env.highlightedCode = highlightedCode;
329
- _.hooks.run('before-insert', env);
330
- env.element.innerHTML = env.highlightedCode;
331
- _.hooks.run('after-highlight', env);
332
- _.hooks.run('complete', env);
333
- callback && callback.call(env.element);
334
- }
335
- _.hooks.run('before-sanity-check', env);
336
- parent = env.element.parentElement;
337
- if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
338
- parent.setAttribute('tabindex', '0');
339
- }
340
- if (!env.code) {
341
- _.hooks.run('complete', env);
342
- callback && callback.call(env.element);
343
- return;
344
- }
345
- _.hooks.run('before-highlight', env);
346
- if (!env.grammar) {
347
- insertHighlightedCode(_.util.encode(env.code));
348
- return;
349
- }
350
- if (async && _self.Worker) {
351
- var worker = new Worker(_.filename);
352
- worker.onmessage = function (evt) {
353
- insertHighlightedCode(evt.data);
354
- };
355
- worker.postMessage(JSON.stringify({
356
- language: env.language,
357
- code: env.code,
358
- immediateClose: true
359
- }));
360
- }
361
- else {
362
- insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
363
- }
364
- },
365
- highlight: function (text, grammar, language) {
366
- var env = {
367
- code: text,
368
- grammar: grammar,
369
- language: language
370
- };
371
- _.hooks.run('before-tokenize', env);
372
- if (!env.grammar) {
373
- throw new Error('The language "' + env.language + '" has no grammar.');
374
- }
375
- env.tokens = _.tokenize(env.code, env.grammar);
376
- _.hooks.run('after-tokenize', env);
377
- return Token.stringify(_.util.encode(env.tokens), env.language);
378
- },
379
- tokenize: function (text, grammar) {
380
- var rest = grammar.rest;
381
- if (rest) {
382
- for (var token in rest) {
383
- grammar[token] = rest[token];
384
- }
385
- delete grammar.rest;
386
- }
387
- var tokenList = new LinkedList();
388
- addAfter(tokenList, tokenList.head, text);
389
- matchGrammar(text, tokenList, grammar, tokenList.head, 0);
390
- return toArray(tokenList);
391
- },
392
- hooks: {
393
- all: {},
394
- add: function (name, callback) {
395
- var hooks = _.hooks.all;
396
- hooks[name] = hooks[name] || [];
397
- hooks[name].push(callback);
398
- },
399
- run: function (name, env) {
400
- var callbacks = _.hooks.all[name];
401
- if (!callbacks || !callbacks.length) {
402
- return;
403
- }
404
- for (var i = 0, callback; callback = callbacks[i++];) {
405
- callback(env);
406
- }
407
- }
408
- },
409
- Token: Token
410
- };
411
- _self.Prism = _;
412
- function Token(type, content, alias, matchedStr) {
413
- this.type = type;
414
- this.content = content;
415
- this.alias = alias;
416
- this.length = (matchedStr || '').length | 0;
417
- }
418
- Token.stringify = function stringify(o, language) {
419
- if (typeof o == 'string') {
420
- return o;
421
- }
422
- if (Array.isArray(o)) {
423
- var s = '';
424
- o.forEach(function (e) {
425
- s += stringify(e, language);
426
- });
427
- return s;
428
- }
429
- var env = {
430
- type: o.type,
431
- content: stringify(o.content, language),
432
- tag: 'span',
433
- classes: [
434
- 'token',
435
- o.type
436
- ],
437
- attributes: {},
438
- language: language
439
- };
440
- var aliases = o.alias;
441
- if (aliases) {
442
- if (Array.isArray(aliases)) {
443
- Array.prototype.push.apply(env.classes, aliases);
444
- }
445
- else {
446
- env.classes.push(aliases);
447
- }
448
- }
449
- _.hooks.run('wrap', env);
450
- var attributes = '';
451
- for (var name in env.attributes) {
452
- attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
453
- }
454
- return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
455
- };
456
- function matchPattern(pattern, pos, text, lookbehind) {
457
- pattern.lastIndex = pos;
458
- var match = pattern.exec(text);
459
- if (match && lookbehind && match[1]) {
460
- var lookbehindLength = match[1].length;
461
- match.index += lookbehindLength;
462
- match[0] = match[0].slice(lookbehindLength);
463
- }
464
- return match;
465
- }
466
- function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
467
- for (var token in grammar) {
468
- if (!grammar.hasOwnProperty(token) || !grammar[token]) {
469
- continue;
470
- }
471
- var patterns = grammar[token];
472
- patterns = Array.isArray(patterns) ? patterns : [patterns];
473
- for (var j = 0; j < patterns.length; ++j) {
474
- if (rematch && rematch.cause == token + ',' + j) {
475
- return;
476
- }
477
- var patternObj = patterns[j];
478
- var inside = patternObj.inside;
479
- var lookbehind = !!patternObj.lookbehind;
480
- var greedy = !!patternObj.greedy;
481
- var alias = patternObj.alias;
482
- if (greedy && !patternObj.pattern.global) {
483
- var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
484
- patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
485
- }
486
- var pattern = patternObj.pattern || patternObj;
487
- for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) {
488
- if (rematch && pos >= rematch.reach) {
489
- break;
490
- }
491
- var str = currentNode.value;
492
- if (tokenList.length > text.length) {
493
- return;
494
- }
495
- if (str instanceof Token) {
496
- continue;
497
- }
498
- var removeCount = 1;
499
- var match;
500
- if (greedy) {
501
- match = matchPattern(pattern, pos, text, lookbehind);
502
- if (!match || match.index >= text.length) {
503
- break;
504
- }
505
- var from = match.index;
506
- var to = match.index + match[0].length;
507
- var p = pos;
508
- p += currentNode.value.length;
509
- while (from >= p) {
510
- currentNode = currentNode.next;
511
- p += currentNode.value.length;
512
- }
513
- p -= currentNode.value.length;
514
- pos = p;
515
- if (currentNode.value instanceof Token) {
516
- continue;
517
- }
518
- for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === 'string'); k = k.next) {
519
- removeCount++;
520
- p += k.value.length;
521
- }
522
- removeCount--;
523
- str = text.slice(pos, p);
524
- match.index -= pos;
525
- }
526
- else {
527
- match = matchPattern(pattern, 0, str, lookbehind);
528
- if (!match) {
529
- continue;
530
- }
531
- }
532
- var from = match.index;
533
- var matchStr = match[0];
534
- var before = str.slice(0, from);
535
- var after = str.slice(from + matchStr.length);
536
- var reach = pos + str.length;
537
- if (rematch && reach > rematch.reach) {
538
- rematch.reach = reach;
539
- }
540
- var removeFrom = currentNode.prev;
541
- if (before) {
542
- removeFrom = addAfter(tokenList, removeFrom, before);
543
- pos += before.length;
544
- }
545
- removeRange(tokenList, removeFrom, removeCount);
546
- var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
547
- currentNode = addAfter(tokenList, removeFrom, wrapped);
548
- if (after) {
549
- addAfter(tokenList, currentNode, after);
550
- }
551
- if (removeCount > 1) {
552
- var nestedRematch = {
553
- cause: token + ',' + j,
554
- reach: reach
555
- };
556
- matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
557
- if (rematch && nestedRematch.reach > rematch.reach) {
558
- rematch.reach = nestedRematch.reach;
559
- }
560
- }
561
- }
562
- }
563
- }
564
- }
565
- function LinkedList() {
566
- var head = {
567
- value: null,
568
- prev: null,
569
- next: null
570
- };
571
- var tail = {
572
- value: null,
573
- prev: head,
574
- next: null
575
- };
576
- head.next = tail;
577
- this.head = head;
578
- this.tail = tail;
579
- this.length = 0;
580
- }
581
- function addAfter(list, node, value) {
582
- var next = node.next;
583
- var newNode = {
584
- value: value,
585
- prev: node,
586
- next: next
587
- };
588
- node.next = newNode;
589
- next.prev = newNode;
590
- list.length++;
591
- return newNode;
592
- }
593
- function removeRange(list, node, count) {
594
- var next = node.next;
595
- for (var i = 0; i < count && next !== list.tail; i++) {
596
- next = next.next;
597
- }
598
- node.next = next;
599
- next.prev = node;
600
- list.length -= i;
601
- }
602
- function toArray(list) {
603
- var array = [];
604
- var node = list.head.next;
605
- while (node !== list.tail) {
606
- array.push(node.value);
607
- node = node.next;
608
- }
609
- return array;
610
- }
611
- if (!_self.document) {
612
- if (!_self.addEventListener) {
613
- return _;
614
- }
615
- if (!_.disableWorkerMessageHandler) {
616
- _self.addEventListener('message', function (evt) {
617
- var message = JSON.parse(evt.data);
618
- var lang = message.language;
619
- var code = message.code;
620
- var immediateClose = message.immediateClose;
621
- _self.postMessage(_.highlight(code, _.languages[lang], lang));
622
- if (immediateClose) {
623
- _self.close();
624
- }
625
- }, false);
626
- }
627
- return _;
628
- }
629
- var script = _.util.currentScript();
630
- if (script) {
631
- _.filename = script.src;
632
- if (script.hasAttribute('data-manual')) {
633
- _.manual = true;
634
- }
635
- }
636
- function highlightAutomaticallyCallback() {
637
- if (!_.manual) {
638
- _.highlightAll();
639
- }
640
- }
641
- if (!_.manual) {
642
- var readyState = document.readyState;
643
- if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
644
- document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
645
- }
646
- else {
647
- if (window.requestAnimationFrame) {
648
- window.requestAnimationFrame(highlightAutomaticallyCallback);
649
- }
650
- else {
651
- window.setTimeout(highlightAutomaticallyCallback, 16);
652
- }
653
- }
654
- }
655
- return _;
656
- }(_self);
657
- if (typeof module !== 'undefined' && module.exports) {
658
- module.exports = Prism;
659
- }
660
- if (typeof global !== 'undefined') {
661
- global.Prism = Prism;
662
- }
663
- Prism.languages.clike = {
664
- 'comment': [
665
- {
666
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
667
- lookbehind: true,
668
- greedy: true
669
- },
670
- {
671
- pattern: /(^|[^\\:])\/\/.*/,
672
- lookbehind: true,
673
- greedy: true
674
- }
675
- ],
676
- 'string': {
677
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
678
- greedy: true
679
- },
680
- 'class-name': {
681
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
682
- lookbehind: true,
683
- inside: { 'punctuation': /[.\\]/ }
684
- },
685
- 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
686
- 'boolean': /\b(?:false|true)\b/,
687
- 'function': /\b\w+(?=\()/,
688
- 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
689
- 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
690
- 'punctuation': /[{}[\];(),.:]/
691
- };
692
- (function (Prism) {
693
- function getPlaceholder(language, index) {
694
- return '___' + language.toUpperCase() + index + '___';
695
- }
696
- Object.defineProperties(Prism.languages['markup-templating'] = {}, {
697
- buildPlaceholders: {
698
- value: function (env, language, placeholderPattern, replaceFilter) {
699
- if (env.language !== language) {
700
- return;
701
- }
702
- var tokenStack = env.tokenStack = [];
703
- env.code = env.code.replace(placeholderPattern, function (match) {
704
- if (typeof replaceFilter === 'function' && !replaceFilter(match)) {
705
- return match;
706
- }
707
- var i = tokenStack.length;
708
- var placeholder;
709
- while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) {
710
- ++i;
711
- }
712
- tokenStack[i] = match;
713
- return placeholder;
714
- });
715
- env.grammar = Prism.languages.markup;
716
- }
717
- },
718
- tokenizePlaceholders: {
719
- value: function (env, language) {
720
- if (env.language !== language || !env.tokenStack) {
721
- return;
722
- }
723
- env.grammar = Prism.languages[language];
724
- var j = 0;
725
- var keys = Object.keys(env.tokenStack);
726
- function walkTokens(tokens) {
727
- for (var i = 0; i < tokens.length; i++) {
728
- if (j >= keys.length) {
729
- break;
730
- }
731
- var token = tokens[i];
732
- if (typeof token === 'string' || token.content && typeof token.content === 'string') {
733
- var k = keys[j];
734
- var t = env.tokenStack[k];
735
- var s = typeof token === 'string' ? token : token.content;
736
- var placeholder = getPlaceholder(language, k);
737
- var index = s.indexOf(placeholder);
738
- if (index > -1) {
739
- ++j;
740
- var before = s.substring(0, index);
741
- var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t);
742
- var after = s.substring(index + placeholder.length);
743
- var replacement = [];
744
- if (before) {
745
- replacement.push.apply(replacement, walkTokens([before]));
746
- }
747
- replacement.push(middle);
748
- if (after) {
749
- replacement.push.apply(replacement, walkTokens([after]));
750
- }
751
- if (typeof token === 'string') {
752
- tokens.splice.apply(tokens, [
753
- i,
754
- 1
755
- ].concat(replacement));
756
- }
757
- else {
758
- token.content = replacement;
759
- }
760
- }
761
- }
762
- else if (token.content) {
763
- walkTokens(token.content);
764
- }
765
- }
766
- return tokens;
767
- }
768
- walkTokens(env.tokens);
769
- }
770
- }
771
- });
772
- }(Prism));
773
- Prism.languages.c = Prism.languages.extend('clike', {
774
- 'comment': {
775
- pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
776
- greedy: true
777
- },
778
- 'string': {
779
- pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
780
- greedy: true
781
- },
782
- 'class-name': {
783
- pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
784
- lookbehind: true
785
- },
786
- 'keyword': /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
787
- 'function': /\b[a-z_]\w*(?=\s*\()/i,
788
- 'number': /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
789
- 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
790
- });
791
- Prism.languages.insertBefore('c', 'string', {
792
- 'char': {
793
- pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
794
- greedy: true
795
- }
796
- });
797
- Prism.languages.insertBefore('c', 'string', {
798
- 'macro': {
799
- pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
800
- lookbehind: true,
801
- greedy: true,
802
- alias: 'property',
803
- inside: {
804
- 'string': [
805
- {
806
- pattern: /^(#\s*include\s*)<[^>]+>/,
807
- lookbehind: true
808
- },
809
- Prism.languages.c['string']
810
- ],
811
- 'char': Prism.languages.c['char'],
812
- 'comment': Prism.languages.c['comment'],
813
- 'macro-name': [
814
- {
815
- pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
816
- lookbehind: true
817
- },
818
- {
819
- pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
820
- lookbehind: true,
821
- alias: 'function'
822
- }
823
- ],
824
- 'directive': {
825
- pattern: /^(#\s*)[a-z]+/,
826
- lookbehind: true,
827
- alias: 'keyword'
828
- },
829
- 'directive-hash': /^#/,
830
- 'punctuation': /##|\\(?=[\r\n])/,
831
- 'expression': {
832
- pattern: /\S[\s\S]*/,
833
- inside: Prism.languages.c
834
- }
835
- }
836
- }
837
- });
838
- Prism.languages.insertBefore('c', 'function', { 'constant': /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/ });
839
- delete Prism.languages.c['boolean'];
840
- (function (Prism) {
841
- var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;
842
- var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function () {
843
- return keyword.source;
844
- });
845
- Prism.languages.cpp = Prism.languages.extend('c', {
846
- 'class-name': [
847
- {
848
- pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g, function () {
849
- return keyword.source;
850
- })),
851
- lookbehind: true
852
- },
853
- /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,
854
- /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,
855
- /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
856
- ],
857
- 'keyword': keyword,
858
- 'number': {
859
- pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
860
- greedy: true
861
- },
862
- 'operator': />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
863
- 'boolean': /\b(?:false|true)\b/
864
- });
865
- Prism.languages.insertBefore('cpp', 'string', {
866
- 'module': {
867
- pattern: RegExp(/(\b(?:import|module)\s+)/.source + '(?:' + /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + '|' + /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, function () {
868
- return modName;
869
- }) + ')'),
870
- lookbehind: true,
871
- greedy: true,
872
- inside: {
873
- 'string': /^[<"][\s\S]+/,
874
- 'operator': /:/,
875
- 'punctuation': /\./
876
- }
877
- },
878
- 'raw-string': {
879
- pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
880
- alias: 'string',
881
- greedy: true
882
- }
883
- });
884
- Prism.languages.insertBefore('cpp', 'keyword', {
885
- 'generic-function': {
886
- pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
887
- inside: {
888
- 'function': /^\w+/,
889
- 'generic': {
890
- pattern: /<[\s\S]+/,
891
- alias: 'class-name',
892
- inside: Prism.languages.cpp
893
- }
894
- }
895
- }
896
- });
897
- Prism.languages.insertBefore('cpp', 'operator', {
898
- 'double-colon': {
899
- pattern: /::/,
900
- alias: 'punctuation'
901
- }
902
- });
903
- Prism.languages.insertBefore('cpp', 'class-name', {
904
- 'base-clause': {
905
- pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
906
- lookbehind: true,
907
- greedy: true,
908
- inside: Prism.languages.extend('cpp', {})
909
- }
910
- });
911
- Prism.languages.insertBefore('inside', 'double-colon', { 'class-name': /\b[a-z_]\w*\b(?!\s*::)/i }, Prism.languages.cpp['base-clause']);
912
- }(Prism));
913
- (function (Prism) {
914
- function replace(pattern, replacements) {
915
- return pattern.replace(/<<(\d+)>>/g, function (m, index) {
916
- return '(?:' + replacements[+index] + ')';
917
- });
918
- }
919
- function re(pattern, replacements, flags) {
920
- return RegExp(replace(pattern, replacements), flags || '');
921
- }
922
- function nested(pattern, depthLog2) {
923
- for (var i = 0; i < depthLog2; i++) {
924
- pattern = pattern.replace(/<<self>>/g, function () {
925
- return '(?:' + pattern + ')';
926
- });
927
- }
928
- return pattern.replace(/<<self>>/g, '[^\\s\\S]');
929
- }
930
- var keywordKinds = {
931
- type: 'bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void',
932
- typeDeclaration: 'class enum interface record struct',
933
- contextual: 'add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)',
934
- other: 'abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield'
935
- };
936
- function keywordsToPattern(words) {
937
- return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b';
938
- }
939
- var typeDeclarationKeywords = keywordsToPattern(keywordKinds.typeDeclaration);
940
- var keywords = RegExp(keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other));
941
- var nonTypeKeywords = keywordsToPattern(keywordKinds.typeDeclaration + ' ' + keywordKinds.contextual + ' ' + keywordKinds.other);
942
- var nonContextualKeywords = keywordsToPattern(keywordKinds.type + ' ' + keywordKinds.typeDeclaration + ' ' + keywordKinds.other);
943
- var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source, 2);
944
- var nestedRound = nested(/\((?:[^()]|<<self>>)*\)/.source, 2);
945
- var name = /@?\b[A-Za-z_]\w*\b/.source;
946
- var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [
947
- name,
948
- generic
949
- ]);
950
- var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [
951
- nonTypeKeywords,
952
- genericName
953
- ]);
954
- var array = /\[\s*(?:,\s*)*\]/.source;
955
- var typeExpressionWithoutTuple = replace(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [
956
- identifier,
957
- array
958
- ]);
959
- var tupleElement = replace(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [
960
- generic,
961
- nestedRound,
962
- array
963
- ]);
964
- var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]);
965
- var typeExpression = replace(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [
966
- tuple,
967
- identifier,
968
- array
969
- ]);
970
- var typeInside = {
971
- 'keyword': keywords,
972
- 'punctuation': /[<>()?,.:[\]]/
973
- };
974
- var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source;
975
- var regularString = /"(?:\\.|[^\\"\r\n])*"/.source;
976
- var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;
977
- Prism.languages.csharp = Prism.languages.extend('clike', {
978
- 'string': [
979
- {
980
- pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]),
981
- lookbehind: true,
982
- greedy: true
983
- },
984
- {
985
- pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
986
- lookbehind: true,
987
- greedy: true
988
- }
989
- ],
990
- 'class-name': [
991
- {
992
- pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [identifier]),
993
- lookbehind: true,
994
- inside: typeInside
995
- },
996
- {
997
- pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [
998
- name,
999
- typeExpression
1000
- ]),
1001
- lookbehind: true,
1002
- inside: typeInside
1003
- },
1004
- {
1005
- pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]),
1006
- lookbehind: true
1007
- },
1008
- {
1009
- pattern: re(/(\b<<0>>\s+)<<1>>/.source, [
1010
- typeDeclarationKeywords,
1011
- genericName
1012
- ]),
1013
- lookbehind: true,
1014
- inside: typeInside
1015
- },
1016
- {
1017
- pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]),
1018
- lookbehind: true,
1019
- inside: typeInside
1020
- },
1021
- {
1022
- pattern: re(/(\bwhere\s+)<<0>>/.source, [name]),
1023
- lookbehind: true
1024
- },
1025
- {
1026
- pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [typeExpressionWithoutTuple]),
1027
- lookbehind: true,
1028
- inside: typeInside
1029
- },
1030
- {
1031
- pattern: re(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [
1032
- typeExpression,
1033
- nonContextualKeywords,
1034
- name
1035
- ]),
1036
- inside: typeInside
1037
- }
1038
- ],
1039
- 'keyword': keywords,
1040
- 'number': /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,
1041
- 'operator': />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
1042
- 'punctuation': /\?\.?|::|[{}[\];(),.:]/
1043
- });
1044
- Prism.languages.insertBefore('csharp', 'number', {
1045
- 'range': {
1046
- pattern: /\.\./,
1047
- alias: 'operator'
1048
- }
1049
- });
1050
- Prism.languages.insertBefore('csharp', 'punctuation', {
1051
- 'named-parameter': {
1052
- pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]),
1053
- lookbehind: true,
1054
- alias: 'punctuation'
1055
- }
1056
- });
1057
- Prism.languages.insertBefore('csharp', 'class-name', {
1058
- 'namespace': {
1059
- pattern: re(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source, [name]),
1060
- lookbehind: true,
1061
- inside: { 'punctuation': /\./ }
1062
- },
1063
- 'type-expression': {
1064
- pattern: re(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source, [nestedRound]),
1065
- lookbehind: true,
1066
- alias: 'class-name',
1067
- inside: typeInside
1068
- },
1069
- 'return-type': {
1070
- pattern: re(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [
1071
- typeExpression,
1072
- identifier
1073
- ]),
1074
- inside: typeInside,
1075
- alias: 'class-name'
1076
- },
1077
- 'constructor-invocation': {
1078
- pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]),
1079
- lookbehind: true,
1080
- inside: typeInside,
1081
- alias: 'class-name'
1082
- },
1083
- 'generic-method': {
1084
- pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [
1085
- name,
1086
- generic
1087
- ]),
1088
- inside: {
1089
- 'function': re(/^<<0>>/.source, [name]),
1090
- 'generic': {
1091
- pattern: RegExp(generic),
1092
- alias: 'class-name',
1093
- inside: typeInside
1094
- }
1095
- }
1096
- },
1097
- 'type-list': {
1098
- pattern: re(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [
1099
- typeDeclarationKeywords,
1100
- genericName,
1101
- name,
1102
- typeExpression,
1103
- keywords.source,
1104
- nestedRound,
1105
- /\bnew\s*\(\s*\)/.source
1106
- ]),
1107
- lookbehind: true,
1108
- inside: {
1109
- 'record-arguments': {
1110
- pattern: re(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [
1111
- genericName,
1112
- nestedRound
1113
- ]),
1114
- lookbehind: true,
1115
- greedy: true,
1116
- inside: Prism.languages.csharp
1117
- },
1118
- 'keyword': keywords,
1119
- 'class-name': {
1120
- pattern: RegExp(typeExpression),
1121
- greedy: true,
1122
- inside: typeInside
1123
- },
1124
- 'punctuation': /[,()]/
1125
- }
1126
- },
1127
- 'preprocessor': {
1128
- pattern: /(^[\t ]*)#.*/m,
1129
- lookbehind: true,
1130
- alias: 'property',
1131
- inside: {
1132
- 'directive': {
1133
- pattern: /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,
1134
- lookbehind: true,
1135
- alias: 'keyword'
1136
- }
1137
- }
1138
- }
1139
- });
1140
- var regularStringOrCharacter = regularString + '|' + character;
1141
- var regularStringCharacterOrComment = replace(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source, [regularStringOrCharacter]);
1142
- var roundExpression = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2);
1143
- var attrTarget = /\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source;
1144
- var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [
1145
- identifier,
1146
- roundExpression
1147
- ]);
1148
- Prism.languages.insertBefore('csharp', 'class-name', {
1149
- 'attribute': {
1150
- pattern: re(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source, [
1151
- attrTarget,
1152
- attr
1153
- ]),
1154
- lookbehind: true,
1155
- greedy: true,
1156
- inside: {
1157
- 'target': {
1158
- pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]),
1159
- alias: 'keyword'
1160
- },
1161
- 'attribute-arguments': {
1162
- pattern: re(/\(<<0>>*\)/.source, [roundExpression]),
1163
- inside: Prism.languages.csharp
1164
- },
1165
- 'class-name': {
1166
- pattern: RegExp(identifier),
1167
- inside: { 'punctuation': /\./ }
1168
- },
1169
- 'punctuation': /[:,]/
1170
- }
1171
- }
1172
- });
1173
- var formatString = /:[^}\r\n]+/.source;
1174
- var mInterpolationRound = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2);
1175
- var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
1176
- mInterpolationRound,
1177
- formatString
1178
- ]);
1179
- var sInterpolationRound = nested(replace(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source, [regularStringOrCharacter]), 2);
1180
- var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [
1181
- sInterpolationRound,
1182
- formatString
1183
- ]);
1184
- function createInterpolationInside(interpolation, interpolationRound) {
1185
- return {
1186
- 'interpolation': {
1187
- pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]),
1188
- lookbehind: true,
1189
- inside: {
1190
- 'format-string': {
1191
- pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [
1192
- interpolationRound,
1193
- formatString
1194
- ]),
1195
- lookbehind: true,
1196
- inside: { 'punctuation': /^:/ }
1197
- },
1198
- 'punctuation': /^\{|\}$/,
1199
- 'expression': {
1200
- pattern: /[\s\S]+/,
1201
- alias: 'language-csharp',
1202
- inside: Prism.languages.csharp
1203
- }
1204
- }
1205
- },
1206
- 'string': /[\s\S]+/
1207
- };
1208
- }
1209
- Prism.languages.insertBefore('csharp', 'string', {
1210
- 'interpolation-string': [
1211
- {
1212
- pattern: re(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source, [mInterpolation]),
1213
- lookbehind: true,
1214
- greedy: true,
1215
- inside: createInterpolationInside(mInterpolation, mInterpolationRound)
1216
- },
1217
- {
1218
- pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [sInterpolation]),
1219
- lookbehind: true,
1220
- greedy: true,
1221
- inside: createInterpolationInside(sInterpolation, sInterpolationRound)
1222
- }
1223
- ],
1224
- 'char': {
1225
- pattern: RegExp(character),
1226
- greedy: true
1227
- }
1228
- });
1229
- Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
1230
- }(Prism));
1231
- (function (Prism) {
1232
- var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1233
- Prism.languages.css = {
1234
- 'comment': /\/\*[\s\S]*?\*\//,
1235
- 'atrule': {
1236
- pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
1237
- inside: {
1238
- 'rule': /^@[\w-]+/,
1239
- 'selector-function-argument': {
1240
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1241
- lookbehind: true,
1242
- alias: 'selector'
1243
- },
1244
- 'keyword': {
1245
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1246
- lookbehind: true
1247
- }
1248
- }
1249
- },
1250
- 'url': {
1251
- pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
1252
- greedy: true,
1253
- inside: {
1254
- 'function': /^url/i,
1255
- 'punctuation': /^\(|\)$/,
1256
- 'string': {
1257
- pattern: RegExp('^' + string.source + '$'),
1258
- alias: 'url'
1259
- }
1260
- }
1261
- },
1262
- 'selector': {
1263
- pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
1264
- lookbehind: true
1265
- },
1266
- 'string': {
1267
- pattern: string,
1268
- greedy: true
1269
- },
1270
- 'property': {
1271
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1272
- lookbehind: true
1273
- },
1274
- 'important': /!important\b/i,
1275
- 'function': {
1276
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1277
- lookbehind: true
1278
- },
1279
- 'punctuation': /[(){};:,]/
1280
- };
1281
- Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
1282
- var markup = Prism.languages.markup;
1283
- if (markup) {
1284
- markup.tag.addInlined('style', 'css');
1285
- markup.tag.addAttribute('style', 'css');
1286
- }
1287
- }(Prism));
1288
- (function (Prism) {
1289
- var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
1290
- var classNamePrefix = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;
1291
- var className = {
1292
- pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
1293
- lookbehind: true,
1294
- inside: {
1295
- 'namespace': {
1296
- pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
1297
- inside: { 'punctuation': /\./ }
1298
- },
1299
- 'punctuation': /\./
1300
- }
1301
- };
1302
- Prism.languages.java = Prism.languages.extend('clike', {
1303
- 'string': {
1304
- pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
1305
- lookbehind: true,
1306
- greedy: true
1307
- },
1308
- 'class-name': [
1309
- className,
1310
- {
1311
- pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
1312
- lookbehind: true,
1313
- inside: className.inside
1314
- },
1315
- {
1316
- pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + classNamePrefix + /[A-Z]\w*\b/.source),
1317
- lookbehind: true,
1318
- inside: className.inside
1319
- }
1320
- ],
1321
- 'keyword': keywords,
1322
- 'function': [
1323
- Prism.languages.clike.function,
1324
- {
1325
- pattern: /(::\s*)[a-z_]\w*/,
1326
- lookbehind: true
1327
- }
1328
- ],
1329
- 'number': /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,
1330
- 'operator': {
1331
- pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
1332
- lookbehind: true
1333
- },
1334
- 'constant': /\b[A-Z][A-Z_\d]+\b/
1335
- });
1336
- Prism.languages.insertBefore('java', 'string', {
1337
- 'triple-quoted-string': {
1338
- pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
1339
- greedy: true,
1340
- alias: 'string'
1341
- },
1342
- 'char': {
1343
- pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
1344
- greedy: true
1345
- }
1346
- });
1347
- Prism.languages.insertBefore('java', 'class-name', {
1348
- 'annotation': {
1349
- pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
1350
- lookbehind: true,
1351
- alias: 'punctuation'
1352
- },
1353
- 'generics': {
1354
- pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
1355
- inside: {
1356
- 'class-name': className,
1357
- 'keyword': keywords,
1358
- 'punctuation': /[<>(),.:]/,
1359
- 'operator': /[?&|]/
1360
- }
1361
- },
1362
- 'import': [
1363
- {
1364
- pattern: RegExp(/(\bimport\s+)/.source + classNamePrefix + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
1365
- lookbehind: true,
1366
- inside: {
1367
- 'namespace': className.inside.namespace,
1368
- 'punctuation': /\./,
1369
- 'operator': /\*/,
1370
- 'class-name': /\w+/
1371
- }
1372
- },
1373
- {
1374
- pattern: RegExp(/(\bimport\s+static\s+)/.source + classNamePrefix + /(?:\w+|\*)(?=\s*;)/.source),
1375
- lookbehind: true,
1376
- alias: 'static',
1377
- inside: {
1378
- 'namespace': className.inside.namespace,
1379
- 'static': /\b\w+$/,
1380
- 'punctuation': /\./,
1381
- 'operator': /\*/,
1382
- 'class-name': /\w+/
1383
- }
1384
- }
1385
- ],
1386
- 'namespace': {
1387
- pattern: RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g, function () {
1388
- return keywords.source;
1389
- })),
1390
- lookbehind: true,
1391
- inside: { 'punctuation': /\./ }
1392
- }
1393
- });
1394
- }(Prism));
1395
- Prism.languages.javascript = Prism.languages.extend('clike', {
1396
- 'class-name': [
1397
- Prism.languages.clike['class-name'],
1398
- {
1399
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1400
- lookbehind: true
1401
- }
1402
- ],
1403
- 'keyword': [
1404
- {
1405
- pattern: /((?:^|\})\s*)catch\b/,
1406
- lookbehind: true
1407
- },
1408
- {
1409
- pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1410
- lookbehind: true
1411
- }
1412
- ],
1413
- 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1414
- 'number': {
1415
- pattern: RegExp(/(^|[^\w$])/.source + '(?:' + (/NaN|Infinity/.source + '|' + /0[bB][01]+(?:_[01]+)*n?/.source + '|' + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + '|' + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + '|' + /\d+(?:_\d+)*n/.source + '|' + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ')' + /(?![\w$])/.source),
1416
- lookbehind: true
1417
- },
1418
- 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1419
- });
1420
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
1421
- Prism.languages.insertBefore('javascript', 'keyword', {
1422
- 'regex': {
1423
- pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + '(?:' + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + '|' + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ')' + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),
1424
- lookbehind: true,
1425
- greedy: true,
1426
- inside: {
1427
- 'regex-source': {
1428
- pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1429
- lookbehind: true,
1430
- alias: 'language-regex',
1431
- inside: Prism.languages.regex
1432
- },
1433
- 'regex-delimiter': /^\/|\/$/,
1434
- 'regex-flags': /^[a-z]+$/
1435
- }
1436
- },
1437
- 'function-variable': {
1438
- pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
1439
- alias: 'function'
1440
- },
1441
- 'parameter': [
1442
- {
1443
- pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1444
- lookbehind: true,
1445
- inside: Prism.languages.javascript
1446
- },
1447
- {
1448
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1449
- lookbehind: true,
1450
- inside: Prism.languages.javascript
1451
- },
1452
- {
1453
- pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1454
- lookbehind: true,
1455
- inside: Prism.languages.javascript
1456
- },
1457
- {
1458
- pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1459
- lookbehind: true,
1460
- inside: Prism.languages.javascript
1461
- }
1462
- ],
1463
- 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1464
- });
1465
- Prism.languages.insertBefore('javascript', 'string', {
1466
- 'hashbang': {
1467
- pattern: /^#!.*/,
1468
- greedy: true,
1469
- alias: 'comment'
1470
- },
1471
- 'template-string': {
1472
- pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1473
- greedy: true,
1474
- inside: {
1475
- 'template-punctuation': {
1476
- pattern: /^`|`$/,
1477
- alias: 'string'
1478
- },
1479
- 'interpolation': {
1480
- pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1481
- lookbehind: true,
1482
- inside: {
1483
- 'interpolation-punctuation': {
1484
- pattern: /^\$\{|\}$/,
1485
- alias: 'punctuation'
1486
- },
1487
- rest: Prism.languages.javascript
1488
- }
1489
- },
1490
- 'string': /[\s\S]+/
1491
- }
1492
- },
1493
- 'string-property': {
1494
- pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
1495
- lookbehind: true,
1496
- greedy: true,
1497
- alias: 'property'
1498
- }
1499
- });
1500
- Prism.languages.insertBefore('javascript', 'operator', {
1501
- 'literal-property': {
1502
- pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1503
- lookbehind: true,
1504
- alias: 'property'
1505
- }
1506
- });
1507
- if (Prism.languages.markup) {
1508
- Prism.languages.markup.tag.addInlined('script', 'javascript');
1509
- Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, 'javascript');
1510
- }
1511
- Prism.languages.js = Prism.languages.javascript;
1512
- Prism.languages.markup = {
1513
- 'comment': {
1514
- pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1515
- greedy: true
1516
- },
1517
- 'prolog': {
1518
- pattern: /<\?[\s\S]+?\?>/,
1519
- greedy: true
1520
- },
1521
- 'doctype': {
1522
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1523
- greedy: true,
1524
- inside: {
1525
- 'internal-subset': {
1526
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1527
- lookbehind: true,
1528
- greedy: true,
1529
- inside: null
1530
- },
1531
- 'string': {
1532
- pattern: /"[^"]*"|'[^']*'/,
1533
- greedy: true
1534
- },
1535
- 'punctuation': /^<!|>$|[[\]]/,
1536
- 'doctype-tag': /^DOCTYPE/i,
1537
- 'name': /[^\s<>'"]+/
1538
- }
1539
- },
1540
- 'cdata': {
1541
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1542
- greedy: true
1543
- },
1544
- 'tag': {
1545
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1546
- greedy: true,
1547
- inside: {
1548
- 'tag': {
1549
- pattern: /^<\/?[^\s>\/]+/,
1550
- inside: {
1551
- 'punctuation': /^<\/?/,
1552
- 'namespace': /^[^\s>\/:]+:/
1553
- }
1554
- },
1555
- 'special-attr': [],
1556
- 'attr-value': {
1557
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1558
- inside: {
1559
- 'punctuation': [
1560
- {
1561
- pattern: /^=/,
1562
- alias: 'attr-equals'
1563
- },
1564
- {
1565
- pattern: /^(\s*)["']|["']$/,
1566
- lookbehind: true
1567
- }
1568
- ]
1569
- }
1570
- },
1571
- 'punctuation': /\/?>/,
1572
- 'attr-name': {
1573
- pattern: /[^\s>\/]+/,
1574
- inside: { 'namespace': /^[^\s>\/:]+:/ }
1575
- }
1576
- }
1577
- },
1578
- 'entity': [
1579
- {
1580
- pattern: /&[\da-z]{1,8};/i,
1581
- alias: 'named-entity'
1582
- },
1583
- /&#x?[\da-f]{1,8};/i
1584
- ]
1585
- };
1586
- Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity'];
1587
- Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
1588
- Prism.hooks.add('wrap', function (env) {
1589
- if (env.type === 'entity') {
1590
- env.attributes['title'] = env.content.replace(/&amp;/, '&');
1591
- }
1592
- });
1593
- Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
1594
- value: function addInlined(tagName, lang) {
1595
- var includedCdataInside = {};
1596
- includedCdataInside['language-' + lang] = {
1597
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1598
- lookbehind: true,
1599
- inside: Prism.languages[lang]
1600
- };
1601
- includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
1602
- var inside = {
1603
- 'included-cdata': {
1604
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1605
- inside: includedCdataInside
1606
- }
1607
- };
1608
- inside['language-' + lang] = {
1609
- pattern: /[\s\S]+/,
1610
- inside: Prism.languages[lang]
1611
- };
1612
- var def = {};
1613
- def[tagName] = {
1614
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () {
1615
- return tagName;
1616
- }), 'i'),
1617
- lookbehind: true,
1618
- greedy: true,
1619
- inside: inside
1620
- };
1621
- Prism.languages.insertBefore('markup', 'cdata', def);
1622
- }
1623
- });
1624
- Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
1625
- value: function (attrName, lang) {
1626
- Prism.languages.markup.tag.inside['special-attr'].push({
1627
- pattern: RegExp(/(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, 'i'),
1628
- lookbehind: true,
1629
- inside: {
1630
- 'attr-name': /^[^\s=]+/,
1631
- 'attr-value': {
1632
- pattern: /=[\s\S]+/,
1633
- inside: {
1634
- 'value': {
1635
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1636
- lookbehind: true,
1637
- alias: [
1638
- lang,
1639
- 'language-' + lang
1640
- ],
1641
- inside: Prism.languages[lang]
1642
- },
1643
- 'punctuation': [
1644
- {
1645
- pattern: /^=/,
1646
- alias: 'attr-equals'
1647
- },
1648
- /"|'/
1649
- ]
1650
- }
1651
- }
1652
- }
1653
- });
1654
- }
1655
- });
1656
- Prism.languages.html = Prism.languages.markup;
1657
- Prism.languages.mathml = Prism.languages.markup;
1658
- Prism.languages.svg = Prism.languages.markup;
1659
- Prism.languages.xml = Prism.languages.extend('markup', {});
1660
- Prism.languages.ssml = Prism.languages.xml;
1661
- Prism.languages.atom = Prism.languages.xml;
1662
- Prism.languages.rss = Prism.languages.xml;
1663
- (function (Prism) {
1664
- var comment = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/;
1665
- var constant = [
1666
- {
1667
- pattern: /\b(?:false|true)\b/i,
1668
- alias: 'boolean'
1669
- },
1670
- {
1671
- pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,
1672
- greedy: true,
1673
- lookbehind: true
1674
- },
1675
- {
1676
- pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,
1677
- greedy: true,
1678
- lookbehind: true
1679
- },
1680
- /\b(?:null)\b/i,
1681
- /\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/
1682
- ];
1683
- var number = /\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i;
1684
- var operator = /<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/;
1685
- var punctuation = /[{}\[\](),:;]/;
1686
- Prism.languages.php = {
1687
- 'delimiter': {
1688
- pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i,
1689
- alias: 'important'
1690
- },
1691
- 'comment': comment,
1692
- 'variable': /\$+(?:\w+\b|(?=\{))/,
1693
- 'package': {
1694
- pattern: /(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
1695
- lookbehind: true,
1696
- inside: { 'punctuation': /\\/ }
1697
- },
1698
- 'class-name-definition': {
1699
- pattern: /(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,
1700
- lookbehind: true,
1701
- alias: 'class-name'
1702
- },
1703
- 'function-definition': {
1704
- pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,
1705
- lookbehind: true,
1706
- alias: 'function'
1707
- },
1708
- 'keyword': [
1709
- {
1710
- pattern: /(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,
1711
- alias: 'type-casting',
1712
- greedy: true,
1713
- lookbehind: true
1714
- },
1715
- {
1716
- pattern: /([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,
1717
- alias: 'type-hint',
1718
- greedy: true,
1719
- lookbehind: true
1720
- },
1721
- {
1722
- pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,
1723
- alias: 'return-type',
1724
- greedy: true,
1725
- lookbehind: true
1726
- },
1727
- {
1728
- pattern: /\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,
1729
- alias: 'type-declaration',
1730
- greedy: true
1731
- },
1732
- {
1733
- pattern: /(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,
1734
- alias: 'type-declaration',
1735
- greedy: true,
1736
- lookbehind: true
1737
- },
1738
- {
1739
- pattern: /\b(?:parent|self|static)(?=\s*::)/i,
1740
- alias: 'static-context',
1741
- greedy: true
1742
- },
1743
- {
1744
- pattern: /(\byield\s+)from\b/i,
1745
- lookbehind: true
1746
- },
1747
- /\bclass\b/i,
1748
- {
1749
- pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,
1750
- lookbehind: true
1751
- }
1752
- ],
1753
- 'argument-name': {
1754
- pattern: /([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,
1755
- lookbehind: true
1756
- },
1757
- 'class-name': [
1758
- {
1759
- pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,
1760
- greedy: true,
1761
- lookbehind: true
1762
- },
1763
- {
1764
- pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i,
1765
- greedy: true,
1766
- lookbehind: true
1767
- },
1768
- {
1769
- pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,
1770
- greedy: true
1771
- },
1772
- {
1773
- pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,
1774
- alias: 'class-name-fully-qualified',
1775
- greedy: true,
1776
- lookbehind: true,
1777
- inside: { 'punctuation': /\\/ }
1778
- },
1779
- {
1780
- pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,
1781
- alias: 'class-name-fully-qualified',
1782
- greedy: true,
1783
- inside: { 'punctuation': /\\/ }
1784
- },
1785
- {
1786
- pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
1787
- alias: 'class-name-fully-qualified',
1788
- greedy: true,
1789
- lookbehind: true,
1790
- inside: { 'punctuation': /\\/ }
1791
- },
1792
- {
1793
- pattern: /\b[a-z_]\w*(?=\s*\$)/i,
1794
- alias: 'type-declaration',
1795
- greedy: true
1796
- },
1797
- {
1798
- pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
1799
- alias: [
1800
- 'class-name-fully-qualified',
1801
- 'type-declaration'
1802
- ],
1803
- greedy: true,
1804
- inside: { 'punctuation': /\\/ }
1805
- },
1806
- {
1807
- pattern: /\b[a-z_]\w*(?=\s*::)/i,
1808
- alias: 'static-context',
1809
- greedy: true
1810
- },
1811
- {
1812
- pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,
1813
- alias: [
1814
- 'class-name-fully-qualified',
1815
- 'static-context'
1816
- ],
1817
- greedy: true,
1818
- inside: { 'punctuation': /\\/ }
1819
- },
1820
- {
1821
- pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,
1822
- alias: 'type-hint',
1823
- greedy: true,
1824
- lookbehind: true
1825
- },
1826
- {
1827
- pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
1828
- alias: [
1829
- 'class-name-fully-qualified',
1830
- 'type-hint'
1831
- ],
1832
- greedy: true,
1833
- lookbehind: true,
1834
- inside: { 'punctuation': /\\/ }
1835
- },
1836
- {
1837
- pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,
1838
- alias: 'return-type',
1839
- greedy: true,
1840
- lookbehind: true
1841
- },
1842
- {
1843
- pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
1844
- alias: [
1845
- 'class-name-fully-qualified',
1846
- 'return-type'
1847
- ],
1848
- greedy: true,
1849
- lookbehind: true,
1850
- inside: { 'punctuation': /\\/ }
1851
- }
1852
- ],
1853
- 'constant': constant,
1854
- 'function': {
1855
- pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,
1856
- lookbehind: true,
1857
- inside: { 'punctuation': /\\/ }
1858
- },
1859
- 'property': {
1860
- pattern: /(->\s*)\w+/,
1861
- lookbehind: true
1862
- },
1863
- 'number': number,
1864
- 'operator': operator,
1865
- 'punctuation': punctuation
1866
- };
1867
- var string_interpolation = {
1868
- pattern: /\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,
1869
- lookbehind: true,
1870
- inside: Prism.languages.php
1871
- };
1872
- var string = [
1873
- {
1874
- pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,
1875
- alias: 'nowdoc-string',
1876
- greedy: true,
1877
- inside: {
1878
- 'delimiter': {
1879
- pattern: /^<<<'[^']+'|[a-z_]\w*;$/i,
1880
- alias: 'symbol',
1881
- inside: { 'punctuation': /^<<<'?|[';]$/ }
1882
- }
1883
- }
1884
- },
1885
- {
1886
- pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,
1887
- alias: 'heredoc-string',
1888
- greedy: true,
1889
- inside: {
1890
- 'delimiter': {
1891
- pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,
1892
- alias: 'symbol',
1893
- inside: { 'punctuation': /^<<<"?|[";]$/ }
1894
- },
1895
- 'interpolation': string_interpolation
1896
- }
1897
- },
1898
- {
1899
- pattern: /`(?:\\[\s\S]|[^\\`])*`/,
1900
- alias: 'backtick-quoted-string',
1901
- greedy: true
1902
- },
1903
- {
1904
- pattern: /'(?:\\[\s\S]|[^\\'])*'/,
1905
- alias: 'single-quoted-string',
1906
- greedy: true
1907
- },
1908
- {
1909
- pattern: /"(?:\\[\s\S]|[^\\"])*"/,
1910
- alias: 'double-quoted-string',
1911
- greedy: true,
1912
- inside: { 'interpolation': string_interpolation }
1913
- }
1914
- ];
1915
- Prism.languages.insertBefore('php', 'variable', {
1916
- 'string': string,
1917
- 'attribute': {
1918
- pattern: /#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,
1919
- greedy: true,
1920
- inside: {
1921
- 'attribute-content': {
1922
- pattern: /^(#\[)[\s\S]+(?=\]$)/,
1923
- lookbehind: true,
1924
- inside: {
1925
- 'comment': comment,
1926
- 'string': string,
1927
- 'attribute-class-name': [
1928
- {
1929
- pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i,
1930
- alias: 'class-name',
1931
- greedy: true,
1932
- lookbehind: true
1933
- },
1934
- {
1935
- pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i,
1936
- alias: [
1937
- 'class-name',
1938
- 'class-name-fully-qualified'
1939
- ],
1940
- greedy: true,
1941
- lookbehind: true,
1942
- inside: { 'punctuation': /\\/ }
1943
- }
1944
- ],
1945
- 'constant': constant,
1946
- 'number': number,
1947
- 'operator': operator,
1948
- 'punctuation': punctuation
1949
- }
1950
- },
1951
- 'delimiter': {
1952
- pattern: /^#\[|\]$/,
1953
- alias: 'punctuation'
1954
- }
1955
- }
1956
- }
1957
- });
1958
- Prism.hooks.add('before-tokenize', function (env) {
1959
- if (!/<\?/.test(env.code)) {
1960
- return;
1961
- }
1962
- var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;
1963
- Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern);
1964
- });
1965
- Prism.hooks.add('after-tokenize', function (env) {
1966
- Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php');
1967
- });
1968
- }(Prism));
1969
- Prism.languages.python = {
1970
- 'comment': {
1971
- pattern: /(^|[^\\])#.*/,
1972
- lookbehind: true,
1973
- greedy: true
1974
- },
1975
- 'string-interpolation': {
1976
- pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
1977
- greedy: true,
1978
- inside: {
1979
- 'interpolation': {
1980
- pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
1981
- lookbehind: true,
1982
- inside: {
1983
- 'format-spec': {
1984
- pattern: /(:)[^:(){}]+(?=\}$)/,
1985
- lookbehind: true
1986
- },
1987
- 'conversion-option': {
1988
- pattern: /![sra](?=[:}]$)/,
1989
- alias: 'punctuation'
1990
- },
1991
- rest: null
1992
- }
1993
- },
1994
- 'string': /[\s\S]+/
1995
- }
1996
- },
1997
- 'triple-quoted-string': {
1998
- pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
1999
- greedy: true,
2000
- alias: 'string'
2001
- },
2002
- 'string': {
2003
- pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
2004
- greedy: true
2005
- },
2006
- 'function': {
2007
- pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
2008
- lookbehind: true
2009
- },
2010
- 'class-name': {
2011
- pattern: /(\bclass\s+)\w+/i,
2012
- lookbehind: true
2013
- },
2014
- 'decorator': {
2015
- pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
2016
- lookbehind: true,
2017
- alias: [
2018
- 'annotation',
2019
- 'punctuation'
2020
- ],
2021
- inside: { 'punctuation': /\./ }
2022
- },
2023
- 'keyword': /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
2024
- 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
2025
- 'boolean': /\b(?:False|None|True)\b/,
2026
- 'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
2027
- 'operator': /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
2028
- 'punctuation': /[{}[\];(),.:]/
2029
- };
2030
- Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
2031
- Prism.languages.py = Prism.languages.python;
2032
- (function (Prism) {
2033
- Prism.languages.ruby = Prism.languages.extend('clike', {
2034
- 'comment': {
2035
- pattern: /#.*|^=begin\s[\s\S]*?^=end/m,
2036
- greedy: true
2037
- },
2038
- 'class-name': {
2039
- pattern: /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
2040
- lookbehind: true,
2041
- inside: { 'punctuation': /[.\\]/ }
2042
- },
2043
- 'keyword': /\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,
2044
- 'operator': /\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
2045
- 'punctuation': /[(){}[\].,;]/
2046
- });
2047
- Prism.languages.insertBefore('ruby', 'operator', {
2048
- 'double-colon': {
2049
- pattern: /::/,
2050
- alias: 'punctuation'
2051
- }
2052
- });
2053
- var interpolation = {
2054
- pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
2055
- lookbehind: true,
2056
- inside: {
2057
- 'content': {
2058
- pattern: /^(#\{)[\s\S]+(?=\}$)/,
2059
- lookbehind: true,
2060
- inside: Prism.languages.ruby
2061
- },
2062
- 'delimiter': {
2063
- pattern: /^#\{|\}$/,
2064
- alias: 'punctuation'
2065
- }
2066
- }
2067
- };
2068
- delete Prism.languages.ruby.function;
2069
- var percentExpression = '(?:' + [
2070
- /([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2071
- /\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,
2072
- /\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,
2073
- /\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,
2074
- /<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source
2075
- ].join('|') + ')';
2076
- var symbolName = /(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;
2077
- Prism.languages.insertBefore('ruby', 'keyword', {
2078
- 'regex-literal': [
2079
- {
2080
- pattern: RegExp(/%r/.source + percentExpression + /[egimnosux]{0,6}/.source),
2081
- greedy: true,
2082
- inside: {
2083
- 'interpolation': interpolation,
2084
- 'regex': /[\s\S]+/
2085
- }
2086
- },
2087
- {
2088
- pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
2089
- lookbehind: true,
2090
- greedy: true,
2091
- inside: {
2092
- 'interpolation': interpolation,
2093
- 'regex': /[\s\S]+/
2094
- }
2095
- }
2096
- ],
2097
- 'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
2098
- 'symbol': [
2099
- {
2100
- pattern: RegExp(/(^|[^:]):/.source + symbolName),
2101
- lookbehind: true,
2102
- greedy: true
2103
- },
2104
- {
2105
- pattern: RegExp(/([\r\n{(,][ \t]*)/.source + symbolName + /(?=:(?!:))/.source),
2106
- lookbehind: true,
2107
- greedy: true
2108
- }
2109
- ],
2110
- 'method-definition': {
2111
- pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
2112
- lookbehind: true,
2113
- inside: {
2114
- 'function': /\b\w+$/,
2115
- 'keyword': /^self\b/,
2116
- 'class-name': /^\w+/,
2117
- 'punctuation': /\./
2118
- }
2119
- }
2120
- });
2121
- Prism.languages.insertBefore('ruby', 'string', {
2122
- 'string-literal': [
2123
- {
2124
- pattern: RegExp(/%[qQiIwWs]?/.source + percentExpression),
2125
- greedy: true,
2126
- inside: {
2127
- 'interpolation': interpolation,
2128
- 'string': /[\s\S]+/
2129
- }
2130
- },
2131
- {
2132
- pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
2133
- greedy: true,
2134
- inside: {
2135
- 'interpolation': interpolation,
2136
- 'string': /[\s\S]+/
2137
- }
2138
- },
2139
- {
2140
- pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2141
- alias: 'heredoc-string',
2142
- greedy: true,
2143
- inside: {
2144
- 'delimiter': {
2145
- pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
2146
- inside: {
2147
- 'symbol': /\b\w+/,
2148
- 'punctuation': /^<<[-~]?/
2149
- }
2150
- },
2151
- 'interpolation': interpolation,
2152
- 'string': /[\s\S]+/
2153
- }
2154
- },
2155
- {
2156
- pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2157
- alias: 'heredoc-string',
2158
- greedy: true,
2159
- inside: {
2160
- 'delimiter': {
2161
- pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
2162
- inside: {
2163
- 'symbol': /\b\w+/,
2164
- 'punctuation': /^<<[-~]?'|'$/
2165
- }
2166
- },
2167
- 'string': /[\s\S]+/
2168
- }
2169
- }
2170
- ],
2171
- 'command-literal': [
2172
- {
2173
- pattern: RegExp(/%x/.source + percentExpression),
2174
- greedy: true,
2175
- inside: {
2176
- 'interpolation': interpolation,
2177
- 'command': {
2178
- pattern: /[\s\S]+/,
2179
- alias: 'string'
2180
- }
2181
- }
2182
- },
2183
- {
2184
- pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
2185
- greedy: true,
2186
- inside: {
2187
- 'interpolation': interpolation,
2188
- 'command': {
2189
- pattern: /[\s\S]+/,
2190
- alias: 'string'
2191
- }
2192
- }
2193
- }
2194
- ]
2195
- });
2196
- delete Prism.languages.ruby.string;
2197
- Prism.languages.insertBefore('ruby', 'number', {
2198
- 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,
2199
- 'constant': /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/
2200
- });
2201
- Prism.languages.rb = Prism.languages.ruby;
2202
- }(Prism));
2203
- window.Prism = oldprism;
2204
- return Prism;
2205
- }(undefined, undefined);
2206
- var option = function (name) { return function (editor) { return editor.options.get(name); }; };
2207
- var register$2 = function (editor) {
2208
- var registerOption = editor.options.register;
2209
- registerOption('codesample_languages', { processor: 'object[]' });
2210
- registerOption('codesample_global_prismjs', {
2211
- processor: 'boolean',
2212
- default: false
2213
- });
2214
- };
2215
- var getLanguages$1 = option('codesample_languages');
2216
- var useGlobalPrismJS = option('codesample_global_prismjs');
2217
- var get = function (editor) { return Global.Prism && useGlobalPrismJS(editor) ? Global.Prism : prismjs; };
2218
- var isCodeSample = function (elm) {
2219
- return isNonNullable(elm) && elm.nodeName === 'PRE' && elm.className.indexOf('language-') !== -1;
2220
- };
2221
- var getSelectedCodeSample = function (editor) {
2222
- var node = editor.selection ? editor.selection.getNode() : null;
2223
- return isCodeSample(node) ? Optional.some(node) : Optional.none();
2224
- };
2225
- var insertCodeSample = function (editor, language, code) {
2226
- var dom = editor.dom;
2227
- editor.undoManager.transact(function () {
2228
- var node = getSelectedCodeSample(editor);
2229
- code = global$1.DOM.encode(code);
2230
- return node.fold(function () {
2231
- editor.insertContent('<pre id="__new" class="language-' + language + '">' + code + '</pre>');
2232
- var newPre = dom.select('#__new')[0];
2233
- dom.setAttrib(newPre, 'id', null);
2234
- editor.selection.select(newPre);
2235
- }, function (n) {
2236
- dom.setAttrib(n, 'class', 'language-' + language);
2237
- n.innerHTML = code;
2238
- get(editor).highlightElement(n);
2239
- editor.selection.select(n);
2240
- });
2241
- });
2242
- };
2243
- var getCurrentCode = function (editor) {
2244
- var node = getSelectedCodeSample(editor);
2245
- return node.bind(function (n) { return Optional.from(n.textContent); }).getOr('');
2246
- };
2247
- var getLanguages = function (editor) {
2248
- var defaultLanguages = [
2249
- {
2250
- text: 'HTML/XML',
2251
- value: 'markup'
2252
- },
2253
- {
2254
- text: 'JavaScript',
2255
- value: 'javascript'
2256
- },
2257
- {
2258
- text: 'CSS',
2259
- value: 'css'
2260
- },
2261
- {
2262
- text: 'PHP',
2263
- value: 'php'
2264
- },
2265
- {
2266
- text: 'Ruby',
2267
- value: 'ruby'
2268
- },
2269
- {
2270
- text: 'Python',
2271
- value: 'python'
2272
- },
2273
- {
2274
- text: 'Java',
2275
- value: 'java'
2276
- },
2277
- {
2278
- text: 'C',
2279
- value: 'c'
2280
- },
2281
- {
2282
- text: 'C#',
2283
- value: 'csharp'
2284
- },
2285
- {
2286
- text: 'C++',
2287
- value: 'cpp'
2288
- }
2289
- ];
2290
- var customLanguages = getLanguages$1(editor);
2291
- return customLanguages ? customLanguages : defaultLanguages;
2292
- };
2293
- var getCurrentLanguage = function (editor, fallback) {
2294
- var node = getSelectedCodeSample(editor);
2295
- return node.fold(function () { return fallback; }, function (n) {
2296
- var matches = n.className.match(/language-(\w+)/);
2297
- return matches ? matches[1] : fallback;
2298
- });
2299
- };
2300
- var open = function (editor) {
2301
- var languages = getLanguages(editor);
2302
- var defaultLanguage = head(languages).fold(constant(''), function (l) { return l.value; });
2303
- var currentLanguage = getCurrentLanguage(editor, defaultLanguage);
2304
- var currentCode = getCurrentCode(editor);
2305
- editor.windowManager.open({
2306
- title: 'Insert/Edit Code Sample',
2307
- size: 'large',
2308
- body: {
2309
- type: 'panel',
2310
- items: [
2311
- {
2312
- type: 'listbox',
2313
- name: 'language',
2314
- label: 'Language',
2315
- items: languages
2316
- },
2317
- {
2318
- type: 'textarea',
2319
- name: 'code',
2320
- label: 'Code view'
2321
- }
2322
- ]
2323
- },
2324
- buttons: [
2325
- {
2326
- type: 'cancel',
2327
- name: 'cancel',
2328
- text: 'Cancel'
2329
- },
2330
- {
2331
- type: 'submit',
2332
- name: 'save',
2333
- text: 'Save',
2334
- primary: true
2335
- }
2336
- ],
2337
- initialData: {
2338
- language: currentLanguage,
2339
- code: currentCode
2340
- },
2341
- onSubmit: function (api) {
2342
- var data = api.getData();
2343
- insertCodeSample(editor, data.language, data.code);
2344
- api.close();
2345
- }
2346
- });
2347
- };
2348
- var register$1 = function (editor) {
2349
- editor.addCommand('codesample', function () {
2350
- var node = editor.selection.getNode();
2351
- if (editor.selection.isCollapsed() || isCodeSample(node)) {
2352
- open(editor);
2353
- }
2354
- else {
2355
- editor.formatter.toggle('code');
2356
- }
2357
- });
2358
- };
2359
- var blank = function (r) { return function (s) { return s.replace(r, ''); }; };
2360
- var trim = blank(/^\s+|\s+$/g);
2361
- var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
2362
- var setup = function (editor) {
2363
- editor.on('PreProcess', function (e) {
2364
- var dom = editor.dom;
2365
- var pres = dom.select('pre[contenteditable=false]', e.node);
2366
- global.each(global.grep(pres, isCodeSample), function (elm) {
2367
- var code = elm.textContent;
2368
- dom.setAttrib(elm, 'class', trim(dom.getAttrib(elm, 'class')));
2369
- dom.setAttrib(elm, 'contentEditable', null);
2370
- dom.setAttrib(elm, 'data-mce-highlighted', null);
2371
- var child;
2372
- while (child = elm.firstChild) {
2373
- elm.removeChild(child);
2374
- }
2375
- var codeElm = dom.add(elm, 'code');
2376
- codeElm.textContent = code;
2377
- });
2378
- });
2379
- editor.on('SetContent', function () {
2380
- var dom = editor.dom;
2381
- var unprocessedCodeSamples = global.grep(dom.select('pre'), function (elm) {
2382
- return isCodeSample(elm) && dom.getAttrib(elm, 'data-mce-highlighted') !== 'true';
2383
- });
2384
- if (unprocessedCodeSamples.length) {
2385
- editor.undoManager.transact(function () {
2386
- global.each(unprocessedCodeSamples, function (elm) {
2387
- var _a;
2388
- global.each(dom.select('br', elm), function (elm) {
2389
- dom.replace(editor.getDoc().createTextNode('\n'), elm);
2390
- });
2391
- elm.innerHTML = dom.encode((_a = elm.textContent) !== null && _a !== void 0 ? _a : '');
2392
- get(editor).highlightElement(elm);
2393
- dom.setAttrib(elm, 'data-mce-highlighted', true);
2394
- elm.className = trim(elm.className);
2395
- });
2396
- });
2397
- }
2398
- });
2399
- editor.on('PreInit', function () {
2400
- editor.parser.addNodeFilter('pre', function (nodes) {
2401
- var _a;
2402
- for (var i = 0, l = nodes.length; i < l; i++) {
2403
- var node = nodes[i];
2404
- var isCodeSample_1 = ((_a = node.attr('class')) !== null && _a !== void 0 ? _a : '').indexOf('language-') !== -1;
2405
- if (isCodeSample_1) {
2406
- node.attr('contenteditable', 'false');
2407
- node.attr('data-mce-highlighted', 'false');
2408
- }
2409
- }
2410
- });
2411
- });
2412
- };
2413
- var onSetupEditable = function (editor, onChanged) {
2414
- if (onChanged === void 0) { onChanged = noop; }
2415
- return function (api) {
2416
- var nodeChanged = function () {
2417
- api.setEnabled(editor.selection.isEditable());
2418
- onChanged(api);
2419
- };
2420
- editor.on('NodeChange', nodeChanged);
2421
- nodeChanged();
2422
- return function () {
2423
- editor.off('NodeChange', nodeChanged);
2424
- };
2425
- };
2426
- };
2427
- var isCodeSampleSelection = function (editor) {
2428
- var node = editor.selection.getStart();
2429
- return editor.dom.is(node, 'pre[class*="language-"]');
2430
- };
2431
- var register = function (editor) {
2432
- var onAction = function () { return editor.execCommand('codesample'); };
2433
- editor.ui.registry.addToggleButton('codesample', {
2434
- icon: 'code-sample',
2435
- tooltip: 'Insert/edit code sample',
2436
- onAction: onAction,
2437
- onSetup: onSetupEditable(editor, function (api) {
2438
- api.setActive(isCodeSampleSelection(editor));
2439
- })
2440
- });
2441
- editor.ui.registry.addMenuItem('codesample', {
2442
- text: 'Code sample...',
2443
- icon: 'code-sample',
2444
- onAction: onAction,
2445
- onSetup: onSetupEditable(editor)
2446
- });
2447
- };
2448
- var Plugin = function () {
2449
- global$2.add('codesample', function (editor) {
2450
- register$2(editor);
2451
- setup(editor);
2452
- register(editor);
2453
- register$1(editor);
2454
- editor.on('dblclick', function (ev) {
2455
- if (isCodeSample(ev.target)) {
2456
- open(editor);
2457
- }
2458
- });
2459
- });
2460
- };
2461
- Plugin();
2462
- })();