mio-previewer 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertPlugin-B74_-nlo.cjs +3 -0
- package/dist/AlertPlugin-DUG0ldg_.js +66 -0
- package/dist/{MdRenderer.vue_vue_type_style_index_0_lang-ClzqKjX4.js → MdRenderer.vue_vue_type_style_index_0_lang-B26E5SLd.js} +1 -1
- package/dist/{MdRenderer.vue_vue_type_style_index_0_lang-Dpnz3CdM.cjs → MdRenderer.vue_vue_type_style_index_0_lang-CT8VuqF6.cjs} +1 -1
- package/dist/{_basePickBy-nvL1-X4h.js → _basePickBy-ClXR16YL.js} +11 -11
- package/dist/_basePickBy-wjzVR2ZI.cjs +1 -0
- package/dist/_baseUniq-BtmrXn_-.cjs +1 -0
- package/dist/{_baseUniq-Cwhfu1XM.js → _baseUniq-BvAvxwqe.js} +13 -13
- package/dist/arc-CBMtpv9r.cjs +1 -0
- package/dist/{arc-C9I4pYLv.js → arc-Hx3N9DvE.js} +1 -1
- package/dist/{architecture-O4VJ6CD3-dKuizgWO.cjs → architecture-O4VJ6CD3-BNArGrzK.cjs} +1 -1
- package/dist/{architecture-O4VJ6CD3-D00QJU0o.js → architecture-O4VJ6CD3-xCUefH5y.js} +1 -1
- package/dist/{architectureDiagram-VXUJARFQ-VWr1UuPv.js → architectureDiagram-VXUJARFQ-B6mJb2i9.js} +20 -21
- package/dist/architectureDiagram-VXUJARFQ-BJuzZIv9.cjs +36 -0
- package/dist/{blockDiagram-VD42YOAC-DuC96I2Q.js → blockDiagram-VD42YOAC-BGxFHnMs.js} +5 -5
- package/dist/{blockDiagram-VD42YOAC-EC2x5LwN.cjs → blockDiagram-VD42YOAC-CG3089Xu.cjs} +1 -1
- package/dist/{c4Diagram-YG6GDRKO-Dm5d0BWL.cjs → c4Diagram-YG6GDRKO-Cmg_2WS3.cjs} +1 -1
- package/dist/{c4Diagram-YG6GDRKO-OB8wIuF8.js → c4Diagram-YG6GDRKO-Rr7zONcv.js} +2 -2
- package/dist/channel-BleEicRr.cjs +1 -0
- package/dist/{channel-C-uR528Z.js → channel-DgGKpNRA.js} +1 -1
- package/dist/{chunk-4BX2VUAB-j8LeaMvy.js → chunk-4BX2VUAB-BbICN0Ec.js} +1 -1
- package/dist/chunk-4BX2VUAB-Bt9zCVip.cjs +1 -0
- package/dist/chunk-55IACEB6-CBJvnwMn.cjs +1 -0
- package/dist/{chunk-55IACEB6-IYAIzfR4.js → chunk-55IACEB6-DYOSrdgH.js} +1 -1
- package/dist/{chunk-B4BG7PRW-DB5df3Iz.js → chunk-B4BG7PRW-TxrPoDdp.js} +4 -4
- package/dist/{chunk-B4BG7PRW-CpqTB0S5.cjs → chunk-B4BG7PRW-l7q-a31H.cjs} +1 -1
- package/dist/{chunk-DI55MBZ5-wqsoqtNw.cjs → chunk-DI55MBZ5-Bp0pNyM4.cjs} +1 -1
- package/dist/{chunk-DI55MBZ5-BoFZpvY3.js → chunk-DI55MBZ5-CsB2AXBx.js} +3 -3
- package/dist/{chunk-FMBD7UC4-BZS_4hun.cjs → chunk-FMBD7UC4-BcpCv0n4.cjs} +1 -1
- package/dist/{chunk-FMBD7UC4-CdmoYYnM.js → chunk-FMBD7UC4-D5PKNbki.js} +1 -1
- package/dist/chunk-QN33PNHL-B1Px0282.cjs +1 -0
- package/dist/{chunk-QN33PNHL-BuyP9RXS.js → chunk-QN33PNHL-B5zdVrte.js} +1 -1
- package/dist/{chunk-QZHKN3VN-15dJyQk0.js → chunk-QZHKN3VN-C-Vfb6xz.js} +1 -1
- package/dist/chunk-QZHKN3VN-Dg1DeAnJ.cjs +1 -0
- package/dist/chunk-TZMSLE5B-Bd4ivTqX.cjs +1 -0
- package/dist/{chunk-TZMSLE5B-BgFWf03M.js → chunk-TZMSLE5B-xm8uzxSg.js} +1 -1
- package/dist/{classDiagram-2ON5EDUG-BQz3UzKi.js → classDiagram-2ON5EDUG-CK_iHiNY.js} +2 -2
- package/dist/classDiagram-2ON5EDUG-DaNkCwSZ.cjs +1 -0
- package/dist/{classDiagram-v2-WZHVMYZB-BQz3UzKi.js → classDiagram-v2-WZHVMYZB-CK_iHiNY.js} +2 -2
- package/dist/classDiagram-v2-WZHVMYZB-DaNkCwSZ.cjs +1 -0
- package/dist/{clone-D6h_cwF4.js → clone-Bha0jTOw.js} +1 -1
- package/dist/clone-C1QAYyzI.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-CV1wgztW.cjs +1 -0
- package/dist/{cose-bilkent-S5V4N54A-D2q7jBXB.js → cose-bilkent-S5V4N54A-hCsgqyKM.js} +5 -6
- package/dist/{plugin-mermaid-y4lbJ7sL.js → custom-B4yTjcNy.js} +8845 -5380
- package/dist/custom-DUStvHau.cjs +263 -0
- package/dist/{dagre-6UL2VRFP-Cfh4UdSr.js → dagre-6UL2VRFP-DgeWg1SE.js} +108 -108
- package/dist/dagre-6UL2VRFP-yXKAxpPT.cjs +4 -0
- package/dist/{diagram-PSM6KHXK-BZDEX43o.js → diagram-PSM6KHXK-Cvtq1BMM.js} +16 -16
- package/dist/diagram-PSM6KHXK-D8-R7SoU.cjs +24 -0
- package/dist/diagram-QEK2KX5R-BJwfOJRv.cjs +43 -0
- package/dist/{diagram-QEK2KX5R-Dda_FEDc.js → diagram-QEK2KX5R-Bk1U0LhS.js} +3 -3
- package/dist/{diagram-S2PKOQOG-Cnw4b7LB.js → diagram-S2PKOQOG-C1GhQvXr.js} +3 -3
- package/dist/diagram-S2PKOQOG-CrU1lFAd.cjs +24 -0
- package/dist/entries/md.cjs.js +1 -1
- package/dist/entries/md.es.js +1 -1
- package/dist/{erDiagram-Q2GNP2WA-qAdA8fbE.js → erDiagram-Q2GNP2WA-BW644HGe.js} +4 -4
- package/dist/{erDiagram-Q2GNP2WA-DE4JLeNF.cjs → erDiagram-Q2GNP2WA-DwCMcLlJ.cjs} +1 -1
- package/dist/{flowDiagram-NV44I4VS-j3dB-fjF.cjs → flowDiagram-NV44I4VS-CwBt-lqk.cjs} +1 -1
- package/dist/{flowDiagram-NV44I4VS-C7YBx4JP.js → flowDiagram-NV44I4VS-wXa2zQjd.js} +5 -5
- package/dist/ganttDiagram-LVOFAZNH-CFZ-PmU5.cjs +267 -0
- package/dist/{ganttDiagram-LVOFAZNH-BL-Yjadx.js → ganttDiagram-LVOFAZNH-DEQvlmR2.js} +55 -56
- package/dist/{gitGraph-ZV4HHKMB-Dr9sn7R3.js → gitGraph-ZV4HHKMB-Bd_PHDMp.js} +1 -1
- package/dist/{gitGraph-ZV4HHKMB-DyXW77WY.cjs → gitGraph-ZV4HHKMB-CbfGP-N9.cjs} +1 -1
- package/dist/gitGraphDiagram-NY62KEGX-j4D9jXL4.cjs +65 -0
- package/dist/{gitGraphDiagram-NY62KEGX-DFn7h5BH.js → gitGraphDiagram-NY62KEGX-xl70htLN.js} +4 -4
- package/dist/graph-6iViBDku.cjs +1 -0
- package/dist/{graph-DiGqaw_6.js → graph-D6yOZd92.js} +7 -7
- package/dist/info-63CPKGFF-du1jd1Lv.js +5 -0
- package/dist/{info-63CPKGFF-BGxbI0Qv.cjs → info-63CPKGFF-gOwyweiZ.cjs} +1 -1
- package/dist/{infoDiagram-F6ZHWCRC-DOtGa28U.js → infoDiagram-F6ZHWCRC-BfGS0mg6.js} +2 -2
- package/dist/infoDiagram-F6ZHWCRC-Vx_DX2z8.cjs +2 -0
- package/dist/{journeyDiagram-XKPGCS4Q-bJncB3oe.js → journeyDiagram-XKPGCS4Q-C74m57vy.js} +4 -4
- package/dist/{journeyDiagram-XKPGCS4Q-h-CtcfbS.cjs → journeyDiagram-XKPGCS4Q-Cwfm3gkE.cjs} +1 -1
- package/dist/{kanban-definition-3W4ZIXB7-C3y0C_bw.cjs → kanban-definition-3W4ZIXB7-CgUhoGem.cjs} +3 -3
- package/dist/{kanban-definition-3W4ZIXB7-nMPCi8GW.js → kanban-definition-3W4ZIXB7-Zs307aAz.js} +2 -2
- package/dist/{layout-CHaNS4g6.js → layout-BVJXml4k.js} +33 -33
- package/dist/layout-DiSbzXpp.cjs +1 -0
- package/dist/{linear-CPFNaVnw.js → linear-BE7L7Wq8.js} +5 -5
- package/dist/linear-CF8o0osj.cjs +1 -0
- package/dist/{mermaid-parser.core-CkQKh-yb.js → mermaid-parser.core-CvS4VcbX.js} +11 -11
- package/dist/{mermaid-parser.core-CR8Rcyps.cjs → mermaid-parser.core-D8AljRep.cjs} +2 -2
- package/dist/{mindmap-definition-VGOIOE7T-C63AEIdU.js → mindmap-definition-VGOIOE7T-BAXsNT0n.js} +3 -3
- package/dist/{mindmap-definition-VGOIOE7T-CHI9UFtA.cjs → mindmap-definition-VGOIOE7T-BidsJOPm.cjs} +1 -1
- package/dist/mio-previewer.cjs.js +2 -2
- package/dist/mio-previewer.css +1 -1
- package/dist/mio-previewer.es.js +12 -4
- package/dist/{packet-HUATNLJX-dnmrn2-l.js → packet-HUATNLJX-B1eLognS.js} +1 -1
- package/dist/{packet-HUATNLJX-BeAGxpDF.cjs → packet-HUATNLJX-CgY4KC5-.cjs} +1 -1
- package/dist/{pie-WTHONI2E-BifrFKgo.cjs → pie-WTHONI2E-DBm7_2Ma.cjs} +1 -1
- package/dist/pie-WTHONI2E-RplLoGbc.js +5 -0
- package/dist/{pieDiagram-ADFJNKIX-CEMFAt9B.js → pieDiagram-ADFJNKIX-CWK1C9xc.js} +4 -4
- package/dist/{pieDiagram-ADFJNKIX-B9OONHi_.cjs → pieDiagram-ADFJNKIX-DTKW3svv.cjs} +1 -1
- package/dist/plugins/custom.cjs.js +1 -0
- package/dist/plugins/custom.es.js +6 -0
- package/dist/plugins/markdown-it.cjs.js +1 -0
- package/dist/{entries/plugin-katex.es.js → plugins/markdown-it.es.js} +20 -7
- package/dist/{quadrantDiagram-AYHSOK5B-DobvzsAU.js → quadrantDiagram-AYHSOK5B-BNrGATyu.js} +2 -2
- package/dist/{quadrantDiagram-AYHSOK5B-DqXDgyBD.cjs → quadrantDiagram-AYHSOK5B-qLZyIHgG.cjs} +3 -3
- package/dist/radar-NJJJXTRR-DRmyBDWp.js +5 -0
- package/dist/{radar-NJJJXTRR-BPN19Spv.cjs → radar-NJJJXTRR-EpcDInzR.cjs} +1 -1
- package/dist/{requirementDiagram-UZGBJVZJ-CVbmNF7M.cjs → requirementDiagram-UZGBJVZJ-BTCSXGaW.cjs} +1 -1
- package/dist/{requirementDiagram-UZGBJVZJ-M-MPvTnX.js → requirementDiagram-UZGBJVZJ-CkxxLi7P.js} +3 -3
- package/dist/sankeyDiagram-TZEHDZUN-BNlI2aP-.cjs +10 -0
- package/dist/{sankeyDiagram-TZEHDZUN-Czsin99f.js → sankeyDiagram-TZEHDZUN-DJ1q5E3K.js} +1 -1
- package/dist/{sequenceDiagram-WL72ISMW-DApIQwP-.cjs → sequenceDiagram-WL72ISMW-CjMzI1c2.cjs} +1 -1
- package/dist/{sequenceDiagram-WL72ISMW-BJByNQsK.js → sequenceDiagram-WL72ISMW-nQ6UBL1y.js} +3 -3
- package/dist/stateDiagram-FKZM4ZOC-BBEPk90z.cjs +1 -0
- package/dist/{stateDiagram-FKZM4ZOC-jAiBDhVn.js → stateDiagram-FKZM4ZOC-Dr_-m8dE.js} +4 -4
- package/dist/{stateDiagram-v2-4FDKWEC3-umSVoFht.js → stateDiagram-v2-4FDKWEC3-CG--f0tc.js} +2 -2
- package/dist/stateDiagram-v2-4FDKWEC3-D7NtOxif.cjs +1 -0
- package/dist/{timeline-definition-IT6M3QCI-BfAvK0gf.cjs → timeline-definition-IT6M3QCI-2DClSZLV.cjs} +3 -3
- package/dist/{timeline-definition-IT6M3QCI-I--lBLTi.js → timeline-definition-IT6M3QCI-d0F8eBhC.js} +2 -2
- package/dist/{treemap-75Q7IDZK-bjql9DgL.js → treemap-75Q7IDZK-BBuuvHE0.js} +1 -1
- package/dist/{treemap-75Q7IDZK-DNt-zuL8.cjs → treemap-75Q7IDZK-CI86AmBT.cjs} +1 -1
- package/dist/types/entries/plugins/custom.d.ts +3 -0
- package/dist/types/entries/plugins/markdown-it.d.ts +2 -0
- package/dist/types/helpers/containerHelpers.d.ts +11 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugins/AlertPlugin.d.ts +10 -8
- package/dist/{xychartDiagram-PRI3JC2R-BN9e47xe.cjs → xychartDiagram-PRI3JC2R-BkUjTJNu.cjs} +1 -1
- package/dist/{xychartDiagram-PRI3JC2R-XrOK_egj.js → xychartDiagram-PRI3JC2R-DLXTvnDG.js} +2 -2
- package/package.json +12 -32
- package/dist/_basePickBy-CZxbwAvt.cjs +0 -1
- package/dist/_baseUniq-DunUk-cd.cjs +0 -1
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
- package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/arc-fCflz0gB.cjs +0 -1
- package/dist/architectureDiagram-VXUJARFQ-DQ-YD3RX.cjs +0 -36
- package/dist/channel-YfH5CBV-.cjs +0 -1
- package/dist/chunk-4BX2VUAB-3Liht_XN.cjs +0 -1
- package/dist/chunk-55IACEB6-Dm3mi3ha.cjs +0 -1
- package/dist/chunk-QN33PNHL-CHI_-zix.cjs +0 -1
- package/dist/chunk-QZHKN3VN-DfH9qQ3T.cjs +0 -1
- package/dist/chunk-TZMSLE5B-qIo1h7Gz.cjs +0 -1
- package/dist/classDiagram-2ON5EDUG-CZWeacVd.cjs +0 -1
- package/dist/classDiagram-v2-WZHVMYZB-CZWeacVd.cjs +0 -1
- package/dist/clone-ByeQKKoW.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-5dO3qpr4.cjs +0 -1
- package/dist/dagre-6UL2VRFP-DS2Ki9Dv.cjs +0 -4
- package/dist/diagram-PSM6KHXK-CTsP6f2a.cjs +0 -24
- package/dist/diagram-QEK2KX5R-BDKMNi97.cjs +0 -43
- package/dist/diagram-S2PKOQOG-CmfsKOvs.cjs +0 -24
- package/dist/entries/plugin-alert.cjs.js +0 -1
- package/dist/entries/plugin-alert.es.js +0 -27
- package/dist/entries/plugin-codeblock.cjs.js +0 -9
- package/dist/entries/plugin-codeblock.es.js +0 -3441
- package/dist/entries/plugin-emoji.cjs.js +0 -1
- package/dist/entries/plugin-emoji.es.js +0 -28
- package/dist/entries/plugin-katex.cjs.js +0 -1
- package/dist/entries/plugin-mermaid.cjs.js +0 -1
- package/dist/entries/plugin-mermaid.es.js +0 -4
- package/dist/ganttDiagram-LVOFAZNH-CBhzET57.cjs +0 -267
- package/dist/gitGraphDiagram-NY62KEGX-DDklxVnY.cjs +0 -65
- package/dist/graph-CHoeKkVR.cjs +0 -1
- package/dist/info-63CPKGFF-xflgSxfH.js +0 -5
- package/dist/infoDiagram-F6ZHWCRC-Duylo4r7.cjs +0 -2
- package/dist/layout-BG4AbhIW.cjs +0 -1
- package/dist/linear-Bqd4C_Yb.cjs +0 -1
- package/dist/pie-WTHONI2E-BKoHQt0i.js +0 -5
- package/dist/plugin-mermaid-FTki7cN8.cjs +0 -255
- package/dist/radar-NJJJXTRR-Bj9rI8mr.js +0 -5
- package/dist/sankeyDiagram-TZEHDZUN-C-ESiLJA.cjs +0 -10
- package/dist/stateDiagram-FKZM4ZOC-BuKL2w66.cjs +0 -1
- package/dist/stateDiagram-v2-4FDKWEC3-Ct5PFxdd.cjs +0 -1
|
@@ -1,3441 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Ae, ref as Z, watch as ve, createElementBlock as $, openBlock as D, createElementVNode as L, withDirectives as we, createCommentVNode as Y, toDisplayString as _e, normalizeClass as X, vShow as ke, h as ee } from "vue";
|
|
2
|
-
import { c as te, g as xe } from "../_commonjsHelpers-DaMA6jEr.js";
|
|
3
|
-
import { _ as Te } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
var V = { exports: {} }, ae;
|
|
5
|
-
function Fe() {
|
|
6
|
-
return ae || (ae = 1, (function(e) {
|
|
7
|
-
var o = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
8
|
-
/**
|
|
9
|
-
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
10
|
-
*
|
|
11
|
-
* @license MIT <https://opensource.org/licenses/MIT>
|
|
12
|
-
* @author Lea Verou <https://lea.verou.me>
|
|
13
|
-
* @namespace
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
var t = (function(s) {
|
|
17
|
-
var b = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, E = 0, h = {}, r = {
|
|
18
|
-
/**
|
|
19
|
-
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
20
|
-
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
21
|
-
* additional languages or plugins yourself.
|
|
22
|
-
*
|
|
23
|
-
* By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
|
|
24
|
-
*
|
|
25
|
-
* You obviously have to change this value before the automatic highlighting started. To do this, you can add an
|
|
26
|
-
* empty Prism object into the global scope before loading the Prism script like this:
|
|
27
|
-
*
|
|
28
|
-
* ```js
|
|
29
|
-
* window.Prism = window.Prism || {};
|
|
30
|
-
* Prism.manual = true;
|
|
31
|
-
* // add a new <script> to load Prism's script
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @default false
|
|
35
|
-
* @type {boolean}
|
|
36
|
-
* @memberof Prism
|
|
37
|
-
* @public
|
|
38
|
-
*/
|
|
39
|
-
manual: s.Prism && s.Prism.manual,
|
|
40
|
-
/**
|
|
41
|
-
* By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
|
|
42
|
-
* `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
|
|
43
|
-
* own worker, you don't want it to do this.
|
|
44
|
-
*
|
|
45
|
-
* By setting this value to `true`, Prism will not add its own listeners to the worker.
|
|
46
|
-
*
|
|
47
|
-
* You obviously have to change this value before Prism executes. To do this, you can add an
|
|
48
|
-
* empty Prism object into the global scope before loading the Prism script like this:
|
|
49
|
-
*
|
|
50
|
-
* ```js
|
|
51
|
-
* window.Prism = window.Prism || {};
|
|
52
|
-
* Prism.disableWorkerMessageHandler = true;
|
|
53
|
-
* // Load Prism's script
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* @default false
|
|
57
|
-
* @type {boolean}
|
|
58
|
-
* @memberof Prism
|
|
59
|
-
* @public
|
|
60
|
-
*/
|
|
61
|
-
disableWorkerMessageHandler: s.Prism && s.Prism.disableWorkerMessageHandler,
|
|
62
|
-
/**
|
|
63
|
-
* A namespace for utility methods.
|
|
64
|
-
*
|
|
65
|
-
* All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
|
|
66
|
-
* change or disappear at any time.
|
|
67
|
-
*
|
|
68
|
-
* @namespace
|
|
69
|
-
* @memberof Prism
|
|
70
|
-
*/
|
|
71
|
-
util: {
|
|
72
|
-
encode: function a(n) {
|
|
73
|
-
return n instanceof c ? new c(n.type, a(n.content), n.alias) : Array.isArray(n) ? n.map(a) : n.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
74
|
-
},
|
|
75
|
-
/**
|
|
76
|
-
* Returns the name of the type of the given value.
|
|
77
|
-
*
|
|
78
|
-
* @param {any} o
|
|
79
|
-
* @returns {string}
|
|
80
|
-
* @example
|
|
81
|
-
* type(null) === 'Null'
|
|
82
|
-
* type(undefined) === 'Undefined'
|
|
83
|
-
* type(123) === 'Number'
|
|
84
|
-
* type('foo') === 'String'
|
|
85
|
-
* type(true) === 'Boolean'
|
|
86
|
-
* type([1, 2]) === 'Array'
|
|
87
|
-
* type({}) === 'Object'
|
|
88
|
-
* type(String) === 'Function'
|
|
89
|
-
* type(/abc+/) === 'RegExp'
|
|
90
|
-
*/
|
|
91
|
-
type: function(a) {
|
|
92
|
-
return Object.prototype.toString.call(a).slice(8, -1);
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* Returns a unique number for the given object. Later calls will still return the same number.
|
|
96
|
-
*
|
|
97
|
-
* @param {Object} obj
|
|
98
|
-
* @returns {number}
|
|
99
|
-
*/
|
|
100
|
-
objId: function(a) {
|
|
101
|
-
return a.__id || Object.defineProperty(a, "__id", { value: ++E }), a.__id;
|
|
102
|
-
},
|
|
103
|
-
/**
|
|
104
|
-
* Creates a deep clone of the given object.
|
|
105
|
-
*
|
|
106
|
-
* The main intended use of this function is to clone language definitions.
|
|
107
|
-
*
|
|
108
|
-
* @param {T} o
|
|
109
|
-
* @param {Record<number, any>} [visited]
|
|
110
|
-
* @returns {T}
|
|
111
|
-
* @template T
|
|
112
|
-
*/
|
|
113
|
-
clone: function a(n, i) {
|
|
114
|
-
i = i || {};
|
|
115
|
-
var u, l;
|
|
116
|
-
switch (r.util.type(n)) {
|
|
117
|
-
case "Object":
|
|
118
|
-
if (l = r.util.objId(n), i[l])
|
|
119
|
-
return i[l];
|
|
120
|
-
u = /** @type {Record<string, any>} */
|
|
121
|
-
{}, i[l] = u;
|
|
122
|
-
for (var f in n)
|
|
123
|
-
n.hasOwnProperty(f) && (u[f] = a(n[f], i));
|
|
124
|
-
return (
|
|
125
|
-
/** @type {any} */
|
|
126
|
-
u
|
|
127
|
-
);
|
|
128
|
-
case "Array":
|
|
129
|
-
return l = r.util.objId(n), i[l] ? i[l] : (u = [], i[l] = u, /** @type {Array} */
|
|
130
|
-
/** @type {any} */
|
|
131
|
-
n.forEach(function(A, g) {
|
|
132
|
-
u[g] = a(A, i);
|
|
133
|
-
}), /** @type {any} */
|
|
134
|
-
u);
|
|
135
|
-
default:
|
|
136
|
-
return n;
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
/**
|
|
140
|
-
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
|
|
141
|
-
*
|
|
142
|
-
* If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
|
|
143
|
-
*
|
|
144
|
-
* @param {Element} element
|
|
145
|
-
* @returns {string}
|
|
146
|
-
*/
|
|
147
|
-
getLanguage: function(a) {
|
|
148
|
-
for (; a; ) {
|
|
149
|
-
var n = b.exec(a.className);
|
|
150
|
-
if (n)
|
|
151
|
-
return n[1].toLowerCase();
|
|
152
|
-
a = a.parentElement;
|
|
153
|
-
}
|
|
154
|
-
return "none";
|
|
155
|
-
},
|
|
156
|
-
/**
|
|
157
|
-
* Sets the Prism `language-xxxx` class of the given element.
|
|
158
|
-
*
|
|
159
|
-
* @param {Element} element
|
|
160
|
-
* @param {string} language
|
|
161
|
-
* @returns {void}
|
|
162
|
-
*/
|
|
163
|
-
setLanguage: function(a, n) {
|
|
164
|
-
a.className = a.className.replace(RegExp(b, "gi"), ""), a.classList.add("language-" + n);
|
|
165
|
-
},
|
|
166
|
-
/**
|
|
167
|
-
* Returns the script element that is currently executing.
|
|
168
|
-
*
|
|
169
|
-
* This does __not__ work for line script element.
|
|
170
|
-
*
|
|
171
|
-
* @returns {HTMLScriptElement | null}
|
|
172
|
-
*/
|
|
173
|
-
currentScript: function() {
|
|
174
|
-
if (typeof document > "u")
|
|
175
|
-
return null;
|
|
176
|
-
if (document.currentScript && document.currentScript.tagName === "SCRIPT")
|
|
177
|
-
return (
|
|
178
|
-
/** @type {any} */
|
|
179
|
-
document.currentScript
|
|
180
|
-
);
|
|
181
|
-
try {
|
|
182
|
-
throw new Error();
|
|
183
|
-
} catch (u) {
|
|
184
|
-
var a = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(u.stack) || [])[1];
|
|
185
|
-
if (a) {
|
|
186
|
-
var n = document.getElementsByTagName("script");
|
|
187
|
-
for (var i in n)
|
|
188
|
-
if (n[i].src == a)
|
|
189
|
-
return n[i];
|
|
190
|
-
}
|
|
191
|
-
return null;
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
/**
|
|
195
|
-
* Returns whether a given class is active for `element`.
|
|
196
|
-
*
|
|
197
|
-
* The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
|
|
198
|
-
* if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
|
|
199
|
-
* given class is just the given class with a `no-` prefix.
|
|
200
|
-
*
|
|
201
|
-
* Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
|
|
202
|
-
* closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
|
|
203
|
-
* ancestors have the given class or the negated version of it, then the default activation will be returned.
|
|
204
|
-
*
|
|
205
|
-
* In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
|
|
206
|
-
* version of it, the class is considered active.
|
|
207
|
-
*
|
|
208
|
-
* @param {Element} element
|
|
209
|
-
* @param {string} className
|
|
210
|
-
* @param {boolean} [defaultActivation=false]
|
|
211
|
-
* @returns {boolean}
|
|
212
|
-
*/
|
|
213
|
-
isActive: function(a, n, i) {
|
|
214
|
-
for (var u = "no-" + n; a; ) {
|
|
215
|
-
var l = a.classList;
|
|
216
|
-
if (l.contains(n))
|
|
217
|
-
return !0;
|
|
218
|
-
if (l.contains(u))
|
|
219
|
-
return !1;
|
|
220
|
-
a = a.parentElement;
|
|
221
|
-
}
|
|
222
|
-
return !!i;
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
/**
|
|
226
|
-
* This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
|
|
227
|
-
*
|
|
228
|
-
* @namespace
|
|
229
|
-
* @memberof Prism
|
|
230
|
-
* @public
|
|
231
|
-
*/
|
|
232
|
-
languages: {
|
|
233
|
-
/**
|
|
234
|
-
* The grammar for plain, unformatted text.
|
|
235
|
-
*/
|
|
236
|
-
plain: h,
|
|
237
|
-
plaintext: h,
|
|
238
|
-
text: h,
|
|
239
|
-
txt: h,
|
|
240
|
-
/**
|
|
241
|
-
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
242
|
-
*
|
|
243
|
-
* If a token in `redef` also appears in the copied language, then the existing token in the copied language
|
|
244
|
-
* will be overwritten at its original position.
|
|
245
|
-
*
|
|
246
|
-
* ## Best practices
|
|
247
|
-
*
|
|
248
|
-
* Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
|
|
249
|
-
* doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
|
|
250
|
-
* understand the language definition because, normally, the order of tokens matters in Prism grammars.
|
|
251
|
-
*
|
|
252
|
-
* Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
|
|
253
|
-
* Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
|
|
254
|
-
*
|
|
255
|
-
* @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
|
|
256
|
-
* @param {Grammar} redef The new tokens to append.
|
|
257
|
-
* @returns {Grammar} The new language created.
|
|
258
|
-
* @public
|
|
259
|
-
* @example
|
|
260
|
-
* Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
|
|
261
|
-
* // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
|
|
262
|
-
* // at its original position
|
|
263
|
-
* 'comment': { ... },
|
|
264
|
-
* // CSS doesn't have a 'color' token, so this token will be appended
|
|
265
|
-
* 'color': /\b(?:red|green|blue)\b/
|
|
266
|
-
* });
|
|
267
|
-
*/
|
|
268
|
-
extend: function(a, n) {
|
|
269
|
-
var i = r.util.clone(r.languages[a]);
|
|
270
|
-
for (var u in n)
|
|
271
|
-
i[u] = n[u];
|
|
272
|
-
return i;
|
|
273
|
-
},
|
|
274
|
-
/**
|
|
275
|
-
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
276
|
-
*
|
|
277
|
-
* ## Usage
|
|
278
|
-
*
|
|
279
|
-
* This helper method makes it easy to modify existing languages. For example, the CSS language definition
|
|
280
|
-
* not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
|
|
281
|
-
* in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
|
|
282
|
-
* appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
|
|
283
|
-
* this:
|
|
284
|
-
*
|
|
285
|
-
* ```js
|
|
286
|
-
* Prism.languages.markup.style = {
|
|
287
|
-
* // token
|
|
288
|
-
* };
|
|
289
|
-
* ```
|
|
290
|
-
*
|
|
291
|
-
* then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
|
|
292
|
-
* before existing tokens. For the CSS example above, you would use it like this:
|
|
293
|
-
*
|
|
294
|
-
* ```js
|
|
295
|
-
* Prism.languages.insertBefore('markup', 'cdata', {
|
|
296
|
-
* 'style': {
|
|
297
|
-
* // token
|
|
298
|
-
* }
|
|
299
|
-
* });
|
|
300
|
-
* ```
|
|
301
|
-
*
|
|
302
|
-
* ## Special cases
|
|
303
|
-
*
|
|
304
|
-
* If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
|
|
305
|
-
* will be ignored.
|
|
306
|
-
*
|
|
307
|
-
* This behavior can be used to insert tokens after `before`:
|
|
308
|
-
*
|
|
309
|
-
* ```js
|
|
310
|
-
* Prism.languages.insertBefore('markup', 'comment', {
|
|
311
|
-
* 'comment': Prism.languages.markup.comment,
|
|
312
|
-
* // tokens after 'comment'
|
|
313
|
-
* });
|
|
314
|
-
* ```
|
|
315
|
-
*
|
|
316
|
-
* ## Limitations
|
|
317
|
-
*
|
|
318
|
-
* The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
|
|
319
|
-
* properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
|
|
320
|
-
* differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
|
|
321
|
-
* deleting properties which is necessary to insert at arbitrary positions.
|
|
322
|
-
*
|
|
323
|
-
* To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
|
|
324
|
-
* Instead, it will create a new object and replace all references to the target object with the new one. This
|
|
325
|
-
* can be done without temporarily deleting properties, so the iteration order is well-defined.
|
|
326
|
-
*
|
|
327
|
-
* However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
|
|
328
|
-
* you hold the target object in a variable, then the value of the variable will not change.
|
|
329
|
-
*
|
|
330
|
-
* ```js
|
|
331
|
-
* var oldMarkup = Prism.languages.markup;
|
|
332
|
-
* var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
|
|
333
|
-
*
|
|
334
|
-
* assert(oldMarkup !== Prism.languages.markup);
|
|
335
|
-
* assert(newMarkup === Prism.languages.markup);
|
|
336
|
-
* ```
|
|
337
|
-
*
|
|
338
|
-
* @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
|
|
339
|
-
* object to be modified.
|
|
340
|
-
* @param {string} before The key to insert before.
|
|
341
|
-
* @param {Grammar} insert An object containing the key-value pairs to be inserted.
|
|
342
|
-
* @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
|
|
343
|
-
* object to be modified.
|
|
344
|
-
*
|
|
345
|
-
* Defaults to `Prism.languages`.
|
|
346
|
-
* @returns {Grammar} The new grammar object.
|
|
347
|
-
* @public
|
|
348
|
-
*/
|
|
349
|
-
insertBefore: function(a, n, i, u) {
|
|
350
|
-
u = u || /** @type {any} */
|
|
351
|
-
r.languages;
|
|
352
|
-
var l = u[a], f = {};
|
|
353
|
-
for (var A in l)
|
|
354
|
-
if (l.hasOwnProperty(A)) {
|
|
355
|
-
if (A == n)
|
|
356
|
-
for (var g in i)
|
|
357
|
-
i.hasOwnProperty(g) && (f[g] = i[g]);
|
|
358
|
-
i.hasOwnProperty(A) || (f[A] = l[A]);
|
|
359
|
-
}
|
|
360
|
-
var k = u[a];
|
|
361
|
-
return u[a] = f, r.languages.DFS(r.languages, function(T, N) {
|
|
362
|
-
N === k && T != a && (this[T] = f);
|
|
363
|
-
}), f;
|
|
364
|
-
},
|
|
365
|
-
// Traverse a language definition with Depth First Search
|
|
366
|
-
DFS: function a(n, i, u, l) {
|
|
367
|
-
l = l || {};
|
|
368
|
-
var f = r.util.objId;
|
|
369
|
-
for (var A in n)
|
|
370
|
-
if (n.hasOwnProperty(A)) {
|
|
371
|
-
i.call(n, A, n[A], u || A);
|
|
372
|
-
var g = n[A], k = r.util.type(g);
|
|
373
|
-
k === "Object" && !l[f(g)] ? (l[f(g)] = !0, a(g, i, null, l)) : k === "Array" && !l[f(g)] && (l[f(g)] = !0, a(g, i, A, l));
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
plugins: {},
|
|
378
|
-
/**
|
|
379
|
-
* This is the most high-level function in Prism’s API.
|
|
380
|
-
* It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
|
|
381
|
-
* each one of them.
|
|
382
|
-
*
|
|
383
|
-
* This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
|
|
384
|
-
*
|
|
385
|
-
* @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
|
|
386
|
-
* @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
|
|
387
|
-
* @memberof Prism
|
|
388
|
-
* @public
|
|
389
|
-
*/
|
|
390
|
-
highlightAll: function(a, n) {
|
|
391
|
-
r.highlightAllUnder(document, a, n);
|
|
392
|
-
},
|
|
393
|
-
/**
|
|
394
|
-
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
395
|
-
* {@link Prism.highlightElement} on each one of them.
|
|
396
|
-
*
|
|
397
|
-
* The following hooks will be run:
|
|
398
|
-
* 1. `before-highlightall`
|
|
399
|
-
* 2. `before-all-elements-highlight`
|
|
400
|
-
* 3. All hooks of {@link Prism.highlightElement} for each element.
|
|
401
|
-
*
|
|
402
|
-
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
|
|
403
|
-
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
|
|
404
|
-
* @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
|
|
405
|
-
* @memberof Prism
|
|
406
|
-
* @public
|
|
407
|
-
*/
|
|
408
|
-
highlightAllUnder: function(a, n, i) {
|
|
409
|
-
var u = {
|
|
410
|
-
callback: i,
|
|
411
|
-
container: a,
|
|
412
|
-
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
413
|
-
};
|
|
414
|
-
r.hooks.run("before-highlightall", u), u.elements = Array.prototype.slice.apply(u.container.querySelectorAll(u.selector)), r.hooks.run("before-all-elements-highlight", u);
|
|
415
|
-
for (var l = 0, f; f = u.elements[l++]; )
|
|
416
|
-
r.highlightElement(f, n === !0, u.callback);
|
|
417
|
-
},
|
|
418
|
-
/**
|
|
419
|
-
* Highlights the code inside a single element.
|
|
420
|
-
*
|
|
421
|
-
* The following hooks will be run:
|
|
422
|
-
* 1. `before-sanity-check`
|
|
423
|
-
* 2. `before-highlight`
|
|
424
|
-
* 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
|
|
425
|
-
* 4. `before-insert`
|
|
426
|
-
* 5. `after-highlight`
|
|
427
|
-
* 6. `complete`
|
|
428
|
-
*
|
|
429
|
-
* Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
|
|
430
|
-
* the element's language.
|
|
431
|
-
*
|
|
432
|
-
* @param {Element} element The element containing the code.
|
|
433
|
-
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
|
|
434
|
-
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
|
|
435
|
-
* to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
|
|
436
|
-
* [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
|
|
437
|
-
*
|
|
438
|
-
* Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
|
|
439
|
-
* asynchronous highlighting to work. You can build your own bundle on the
|
|
440
|
-
* [Download page](https://prismjs.com/download.html).
|
|
441
|
-
* @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
|
|
442
|
-
* Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
|
|
443
|
-
* @memberof Prism
|
|
444
|
-
* @public
|
|
445
|
-
*/
|
|
446
|
-
highlightElement: function(a, n, i) {
|
|
447
|
-
var u = r.util.getLanguage(a), l = r.languages[u];
|
|
448
|
-
r.util.setLanguage(a, u);
|
|
449
|
-
var f = a.parentElement;
|
|
450
|
-
f && f.nodeName.toLowerCase() === "pre" && r.util.setLanguage(f, u);
|
|
451
|
-
var A = a.textContent, g = {
|
|
452
|
-
element: a,
|
|
453
|
-
language: u,
|
|
454
|
-
grammar: l,
|
|
455
|
-
code: A
|
|
456
|
-
};
|
|
457
|
-
function k(N) {
|
|
458
|
-
g.highlightedCode = N, r.hooks.run("before-insert", g), g.element.innerHTML = g.highlightedCode, r.hooks.run("after-highlight", g), r.hooks.run("complete", g), i && i.call(g.element);
|
|
459
|
-
}
|
|
460
|
-
if (r.hooks.run("before-sanity-check", g), f = g.element.parentElement, f && f.nodeName.toLowerCase() === "pre" && !f.hasAttribute("tabindex") && f.setAttribute("tabindex", "0"), !g.code) {
|
|
461
|
-
r.hooks.run("complete", g), i && i.call(g.element);
|
|
462
|
-
return;
|
|
463
|
-
}
|
|
464
|
-
if (r.hooks.run("before-highlight", g), !g.grammar) {
|
|
465
|
-
k(r.util.encode(g.code));
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
if (n && s.Worker) {
|
|
469
|
-
var T = new Worker(r.filename);
|
|
470
|
-
T.onmessage = function(N) {
|
|
471
|
-
k(N.data);
|
|
472
|
-
}, T.postMessage(JSON.stringify({
|
|
473
|
-
language: g.language,
|
|
474
|
-
code: g.code,
|
|
475
|
-
immediateClose: !0
|
|
476
|
-
}));
|
|
477
|
-
} else
|
|
478
|
-
k(r.highlight(g.code, g.grammar, g.language));
|
|
479
|
-
},
|
|
480
|
-
/**
|
|
481
|
-
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
482
|
-
* and the language definitions to use, and returns a string with the HTML produced.
|
|
483
|
-
*
|
|
484
|
-
* The following hooks will be run:
|
|
485
|
-
* 1. `before-tokenize`
|
|
486
|
-
* 2. `after-tokenize`
|
|
487
|
-
* 3. `wrap`: On each {@link Token}.
|
|
488
|
-
*
|
|
489
|
-
* @param {string} text A string with the code to be highlighted.
|
|
490
|
-
* @param {Grammar} grammar An object containing the tokens to use.
|
|
491
|
-
*
|
|
492
|
-
* Usually a language definition like `Prism.languages.markup`.
|
|
493
|
-
* @param {string} language The name of the language definition passed to `grammar`.
|
|
494
|
-
* @returns {string} The highlighted HTML.
|
|
495
|
-
* @memberof Prism
|
|
496
|
-
* @public
|
|
497
|
-
* @example
|
|
498
|
-
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
499
|
-
*/
|
|
500
|
-
highlight: function(a, n, i) {
|
|
501
|
-
var u = {
|
|
502
|
-
code: a,
|
|
503
|
-
grammar: n,
|
|
504
|
-
language: i
|
|
505
|
-
};
|
|
506
|
-
if (r.hooks.run("before-tokenize", u), !u.grammar)
|
|
507
|
-
throw new Error('The language "' + u.language + '" has no grammar.');
|
|
508
|
-
return u.tokens = r.tokenize(u.code, u.grammar), r.hooks.run("after-tokenize", u), c.stringify(r.util.encode(u.tokens), u.language);
|
|
509
|
-
},
|
|
510
|
-
/**
|
|
511
|
-
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
512
|
-
* and the language definitions to use, and returns an array with the tokenized code.
|
|
513
|
-
*
|
|
514
|
-
* When the language definition includes nested tokens, the function is called recursively on each of these tokens.
|
|
515
|
-
*
|
|
516
|
-
* This method could be useful in other contexts as well, as a very crude parser.
|
|
517
|
-
*
|
|
518
|
-
* @param {string} text A string with the code to be highlighted.
|
|
519
|
-
* @param {Grammar} grammar An object containing the tokens to use.
|
|
520
|
-
*
|
|
521
|
-
* Usually a language definition like `Prism.languages.markup`.
|
|
522
|
-
* @returns {TokenStream} An array of strings and tokens, a token stream.
|
|
523
|
-
* @memberof Prism
|
|
524
|
-
* @public
|
|
525
|
-
* @example
|
|
526
|
-
* let code = `var foo = 0;`;
|
|
527
|
-
* let tokens = Prism.tokenize(code, Prism.languages.javascript);
|
|
528
|
-
* tokens.forEach(token => {
|
|
529
|
-
* if (token instanceof Prism.Token && token.type === 'number') {
|
|
530
|
-
* console.log(`Found numeric literal: ${token.content}`);
|
|
531
|
-
* }
|
|
532
|
-
* });
|
|
533
|
-
*/
|
|
534
|
-
tokenize: function(a, n) {
|
|
535
|
-
var i = n.rest;
|
|
536
|
-
if (i) {
|
|
537
|
-
for (var u in i)
|
|
538
|
-
n[u] = i[u];
|
|
539
|
-
delete n.rest;
|
|
540
|
-
}
|
|
541
|
-
var l = new p();
|
|
542
|
-
return _(l, l.head, a), m(a, l, n, l.head, 0), x(l);
|
|
543
|
-
},
|
|
544
|
-
/**
|
|
545
|
-
* @namespace
|
|
546
|
-
* @memberof Prism
|
|
547
|
-
* @public
|
|
548
|
-
*/
|
|
549
|
-
hooks: {
|
|
550
|
-
all: {},
|
|
551
|
-
/**
|
|
552
|
-
* Adds the given callback to the list of callbacks for the given hook.
|
|
553
|
-
*
|
|
554
|
-
* The callback will be invoked when the hook it is registered for is run.
|
|
555
|
-
* Hooks are usually directly run by a highlight function but you can also run hooks yourself.
|
|
556
|
-
*
|
|
557
|
-
* One callback function can be registered to multiple hooks and the same hook multiple times.
|
|
558
|
-
*
|
|
559
|
-
* @param {string} name The name of the hook.
|
|
560
|
-
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
561
|
-
* @public
|
|
562
|
-
*/
|
|
563
|
-
add: function(a, n) {
|
|
564
|
-
var i = r.hooks.all;
|
|
565
|
-
i[a] = i[a] || [], i[a].push(n);
|
|
566
|
-
},
|
|
567
|
-
/**
|
|
568
|
-
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
569
|
-
*
|
|
570
|
-
* Callbacks will be invoked synchronously and in the order in which they were registered.
|
|
571
|
-
*
|
|
572
|
-
* @param {string} name The name of the hook.
|
|
573
|
-
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
574
|
-
* @public
|
|
575
|
-
*/
|
|
576
|
-
run: function(a, n) {
|
|
577
|
-
var i = r.hooks.all[a];
|
|
578
|
-
if (!(!i || !i.length))
|
|
579
|
-
for (var u = 0, l; l = i[u++]; )
|
|
580
|
-
l(n);
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
Token: c
|
|
584
|
-
};
|
|
585
|
-
s.Prism = r;
|
|
586
|
-
function c(a, n, i, u) {
|
|
587
|
-
this.type = a, this.content = n, this.alias = i, this.length = (u || "").length | 0;
|
|
588
|
-
}
|
|
589
|
-
c.stringify = function a(n, i) {
|
|
590
|
-
if (typeof n == "string")
|
|
591
|
-
return n;
|
|
592
|
-
if (Array.isArray(n)) {
|
|
593
|
-
var u = "";
|
|
594
|
-
return n.forEach(function(k) {
|
|
595
|
-
u += a(k, i);
|
|
596
|
-
}), u;
|
|
597
|
-
}
|
|
598
|
-
var l = {
|
|
599
|
-
type: n.type,
|
|
600
|
-
content: a(n.content, i),
|
|
601
|
-
tag: "span",
|
|
602
|
-
classes: ["token", n.type],
|
|
603
|
-
attributes: {},
|
|
604
|
-
language: i
|
|
605
|
-
}, f = n.alias;
|
|
606
|
-
f && (Array.isArray(f) ? Array.prototype.push.apply(l.classes, f) : l.classes.push(f)), r.hooks.run("wrap", l);
|
|
607
|
-
var A = "";
|
|
608
|
-
for (var g in l.attributes)
|
|
609
|
-
A += " " + g + '="' + (l.attributes[g] || "").replace(/"/g, """) + '"';
|
|
610
|
-
return "<" + l.tag + ' class="' + l.classes.join(" ") + '"' + A + ">" + l.content + "</" + l.tag + ">";
|
|
611
|
-
};
|
|
612
|
-
function d(a, n, i, u) {
|
|
613
|
-
a.lastIndex = n;
|
|
614
|
-
var l = a.exec(i);
|
|
615
|
-
if (l && u && l[1]) {
|
|
616
|
-
var f = l[1].length;
|
|
617
|
-
l.index += f, l[0] = l[0].slice(f);
|
|
618
|
-
}
|
|
619
|
-
return l;
|
|
620
|
-
}
|
|
621
|
-
function m(a, n, i, u, l, f) {
|
|
622
|
-
for (var A in i)
|
|
623
|
-
if (!(!i.hasOwnProperty(A) || !i[A])) {
|
|
624
|
-
var g = i[A];
|
|
625
|
-
g = Array.isArray(g) ? g : [g];
|
|
626
|
-
for (var k = 0; k < g.length; ++k) {
|
|
627
|
-
if (f && f.cause == A + "," + k)
|
|
628
|
-
return;
|
|
629
|
-
var T = g[k], N = T.inside, K = !!T.lookbehind, W = !!T.greedy, me = T.alias;
|
|
630
|
-
if (W && !T.pattern.global) {
|
|
631
|
-
var Ee = T.pattern.toString().match(/[imsuy]*$/)[0];
|
|
632
|
-
T.pattern = RegExp(T.pattern.source, Ee + "g");
|
|
633
|
-
}
|
|
634
|
-
for (var J = T.pattern || T, F = u.next, I = l; F !== n.tail && !(f && I >= f.reach); I += F.value.length, F = F.next) {
|
|
635
|
-
var C = F.value;
|
|
636
|
-
if (n.length > a.length)
|
|
637
|
-
return;
|
|
638
|
-
if (!(C instanceof c)) {
|
|
639
|
-
var z = 1, R;
|
|
640
|
-
if (W) {
|
|
641
|
-
if (R = d(J, I, a, K), !R || R.index >= a.length)
|
|
642
|
-
break;
|
|
643
|
-
var M = R.index, ye = R.index + R[0].length, O = I;
|
|
644
|
-
for (O += F.value.length; M >= O; )
|
|
645
|
-
F = F.next, O += F.value.length;
|
|
646
|
-
if (O -= F.value.length, I = O, F.value instanceof c)
|
|
647
|
-
continue;
|
|
648
|
-
for (var P = F; P !== n.tail && (O < ye || typeof P.value == "string"); P = P.next)
|
|
649
|
-
z++, O += P.value.length;
|
|
650
|
-
z--, C = a.slice(I, O), R.index -= I;
|
|
651
|
-
} else if (R = d(J, 0, C, K), !R)
|
|
652
|
-
continue;
|
|
653
|
-
var M = R.index, B = R[0], G = C.slice(0, M), Q = C.slice(M + B.length), j = I + C.length;
|
|
654
|
-
f && j > f.reach && (f.reach = j);
|
|
655
|
-
var U = F.prev;
|
|
656
|
-
G && (U = _(n, U, G), I += G.length), w(n, U, z);
|
|
657
|
-
var Se = new c(A, N ? r.tokenize(B, N) : B, me, B);
|
|
658
|
-
if (F = _(n, U, Se), Q && _(n, F, Q), z > 1) {
|
|
659
|
-
var q = {
|
|
660
|
-
cause: A + "," + k,
|
|
661
|
-
reach: j
|
|
662
|
-
};
|
|
663
|
-
m(a, n, i, F.prev, I, q), f && q.reach > f.reach && (f.reach = q.reach);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
function p() {
|
|
671
|
-
var a = { value: null, prev: null, next: null }, n = { value: null, prev: a, next: null };
|
|
672
|
-
a.next = n, this.head = a, this.tail = n, this.length = 0;
|
|
673
|
-
}
|
|
674
|
-
function _(a, n, i) {
|
|
675
|
-
var u = n.next, l = { value: i, prev: n, next: u };
|
|
676
|
-
return n.next = l, u.prev = l, a.length++, l;
|
|
677
|
-
}
|
|
678
|
-
function w(a, n, i) {
|
|
679
|
-
for (var u = n.next, l = 0; l < i && u !== a.tail; l++)
|
|
680
|
-
u = u.next;
|
|
681
|
-
n.next = u, u.prev = n, a.length -= l;
|
|
682
|
-
}
|
|
683
|
-
function x(a) {
|
|
684
|
-
for (var n = [], i = a.head.next; i !== a.tail; )
|
|
685
|
-
n.push(i.value), i = i.next;
|
|
686
|
-
return n;
|
|
687
|
-
}
|
|
688
|
-
if (!s.document)
|
|
689
|
-
return s.addEventListener && (r.disableWorkerMessageHandler || s.addEventListener("message", function(a) {
|
|
690
|
-
var n = JSON.parse(a.data), i = n.language, u = n.code, l = n.immediateClose;
|
|
691
|
-
s.postMessage(r.highlight(u, r.languages[i], i)), l && s.close();
|
|
692
|
-
}, !1)), r;
|
|
693
|
-
var v = r.util.currentScript();
|
|
694
|
-
v && (r.filename = v.src, v.hasAttribute("data-manual") && (r.manual = !0));
|
|
695
|
-
function y() {
|
|
696
|
-
r.manual || r.highlightAll();
|
|
697
|
-
}
|
|
698
|
-
if (!r.manual) {
|
|
699
|
-
var S = document.readyState;
|
|
700
|
-
S === "loading" || S === "interactive" && v && v.defer ? document.addEventListener("DOMContentLoaded", y) : window.requestAnimationFrame ? window.requestAnimationFrame(y) : window.setTimeout(y, 16);
|
|
701
|
-
}
|
|
702
|
-
return r;
|
|
703
|
-
})(o);
|
|
704
|
-
e.exports && (e.exports = t), typeof te < "u" && (te.Prism = t), t.languages.markup = {
|
|
705
|
-
comment: {
|
|
706
|
-
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
707
|
-
greedy: !0
|
|
708
|
-
},
|
|
709
|
-
prolog: {
|
|
710
|
-
pattern: /<\?[\s\S]+?\?>/,
|
|
711
|
-
greedy: !0
|
|
712
|
-
},
|
|
713
|
-
doctype: {
|
|
714
|
-
// https://www.w3.org/TR/xml/#NT-doctypedecl
|
|
715
|
-
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
|
716
|
-
greedy: !0,
|
|
717
|
-
inside: {
|
|
718
|
-
"internal-subset": {
|
|
719
|
-
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
|
720
|
-
lookbehind: !0,
|
|
721
|
-
greedy: !0,
|
|
722
|
-
inside: null
|
|
723
|
-
// see below
|
|
724
|
-
},
|
|
725
|
-
string: {
|
|
726
|
-
pattern: /"[^"]*"|'[^']*'/,
|
|
727
|
-
greedy: !0
|
|
728
|
-
},
|
|
729
|
-
punctuation: /^<!|>$|[[\]]/,
|
|
730
|
-
"doctype-tag": /^DOCTYPE/i,
|
|
731
|
-
name: /[^\s<>'"]+/
|
|
732
|
-
}
|
|
733
|
-
},
|
|
734
|
-
cdata: {
|
|
735
|
-
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
736
|
-
greedy: !0
|
|
737
|
-
},
|
|
738
|
-
tag: {
|
|
739
|
-
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
|
740
|
-
greedy: !0,
|
|
741
|
-
inside: {
|
|
742
|
-
tag: {
|
|
743
|
-
pattern: /^<\/?[^\s>\/]+/,
|
|
744
|
-
inside: {
|
|
745
|
-
punctuation: /^<\/?/,
|
|
746
|
-
namespace: /^[^\s>\/:]+:/
|
|
747
|
-
}
|
|
748
|
-
},
|
|
749
|
-
"special-attr": [],
|
|
750
|
-
"attr-value": {
|
|
751
|
-
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
|
|
752
|
-
inside: {
|
|
753
|
-
punctuation: [
|
|
754
|
-
{
|
|
755
|
-
pattern: /^=/,
|
|
756
|
-
alias: "attr-equals"
|
|
757
|
-
},
|
|
758
|
-
{
|
|
759
|
-
pattern: /^(\s*)["']|["']$/,
|
|
760
|
-
lookbehind: !0
|
|
761
|
-
}
|
|
762
|
-
]
|
|
763
|
-
}
|
|
764
|
-
},
|
|
765
|
-
punctuation: /\/?>/,
|
|
766
|
-
"attr-name": {
|
|
767
|
-
pattern: /[^\s>\/]+/,
|
|
768
|
-
inside: {
|
|
769
|
-
namespace: /^[^\s>\/:]+:/
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
},
|
|
774
|
-
entity: [
|
|
775
|
-
{
|
|
776
|
-
pattern: /&[\da-z]{1,8};/i,
|
|
777
|
-
alias: "named-entity"
|
|
778
|
-
},
|
|
779
|
-
/&#x?[\da-f]{1,8};/i
|
|
780
|
-
]
|
|
781
|
-
}, t.languages.markup.tag.inside["attr-value"].inside.entity = t.languages.markup.entity, t.languages.markup.doctype.inside["internal-subset"].inside = t.languages.markup, t.hooks.add("wrap", function(s) {
|
|
782
|
-
s.type === "entity" && (s.attributes.title = s.content.replace(/&/, "&"));
|
|
783
|
-
}), Object.defineProperty(t.languages.markup.tag, "addInlined", {
|
|
784
|
-
/**
|
|
785
|
-
* Adds an inlined language to markup.
|
|
786
|
-
*
|
|
787
|
-
* An example of an inlined language is CSS with `<style>` tags.
|
|
788
|
-
*
|
|
789
|
-
* @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
|
|
790
|
-
* case insensitive.
|
|
791
|
-
* @param {string} lang The language key.
|
|
792
|
-
* @example
|
|
793
|
-
* addInlined('style', 'css');
|
|
794
|
-
*/
|
|
795
|
-
value: function(b, E) {
|
|
796
|
-
var h = {};
|
|
797
|
-
h["language-" + E] = {
|
|
798
|
-
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
799
|
-
lookbehind: !0,
|
|
800
|
-
inside: t.languages[E]
|
|
801
|
-
}, h.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
802
|
-
var r = {
|
|
803
|
-
"included-cdata": {
|
|
804
|
-
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
805
|
-
inside: h
|
|
806
|
-
}
|
|
807
|
-
};
|
|
808
|
-
r["language-" + E] = {
|
|
809
|
-
pattern: /[\s\S]+/,
|
|
810
|
-
inside: t.languages[E]
|
|
811
|
-
};
|
|
812
|
-
var c = {};
|
|
813
|
-
c[b] = {
|
|
814
|
-
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
815
|
-
return b;
|
|
816
|
-
}), "i"),
|
|
817
|
-
lookbehind: !0,
|
|
818
|
-
greedy: !0,
|
|
819
|
-
inside: r
|
|
820
|
-
}, t.languages.insertBefore("markup", "cdata", c);
|
|
821
|
-
}
|
|
822
|
-
}), Object.defineProperty(t.languages.markup.tag, "addAttribute", {
|
|
823
|
-
/**
|
|
824
|
-
* Adds an pattern to highlight languages embedded in HTML attributes.
|
|
825
|
-
*
|
|
826
|
-
* An example of an inlined language is CSS with `style` attributes.
|
|
827
|
-
*
|
|
828
|
-
* @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
|
|
829
|
-
* case insensitive.
|
|
830
|
-
* @param {string} lang The language key.
|
|
831
|
-
* @example
|
|
832
|
-
* addAttribute('style', 'css');
|
|
833
|
-
*/
|
|
834
|
-
value: function(s, b) {
|
|
835
|
-
t.languages.markup.tag.inside["special-attr"].push({
|
|
836
|
-
pattern: RegExp(
|
|
837
|
-
/(^|["'\s])/.source + "(?:" + s + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
838
|
-
"i"
|
|
839
|
-
),
|
|
840
|
-
lookbehind: !0,
|
|
841
|
-
inside: {
|
|
842
|
-
"attr-name": /^[^\s=]+/,
|
|
843
|
-
"attr-value": {
|
|
844
|
-
pattern: /=[\s\S]+/,
|
|
845
|
-
inside: {
|
|
846
|
-
value: {
|
|
847
|
-
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
848
|
-
lookbehind: !0,
|
|
849
|
-
alias: [b, "language-" + b],
|
|
850
|
-
inside: t.languages[b]
|
|
851
|
-
},
|
|
852
|
-
punctuation: [
|
|
853
|
-
{
|
|
854
|
-
pattern: /^=/,
|
|
855
|
-
alias: "attr-equals"
|
|
856
|
-
},
|
|
857
|
-
/"|'/
|
|
858
|
-
]
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
});
|
|
863
|
-
}
|
|
864
|
-
}), t.languages.html = t.languages.markup, t.languages.mathml = t.languages.markup, t.languages.svg = t.languages.markup, t.languages.xml = t.languages.extend("markup", {}), t.languages.ssml = t.languages.xml, t.languages.atom = t.languages.xml, t.languages.rss = t.languages.xml, (function(s) {
|
|
865
|
-
var b = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
866
|
-
s.languages.css = {
|
|
867
|
-
comment: /\/\*[\s\S]*?\*\//,
|
|
868
|
-
atrule: {
|
|
869
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + b.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
870
|
-
inside: {
|
|
871
|
-
rule: /^@[\w-]+/,
|
|
872
|
-
"selector-function-argument": {
|
|
873
|
-
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
874
|
-
lookbehind: !0,
|
|
875
|
-
alias: "selector"
|
|
876
|
-
},
|
|
877
|
-
keyword: {
|
|
878
|
-
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
879
|
-
lookbehind: !0
|
|
880
|
-
}
|
|
881
|
-
// See rest below
|
|
882
|
-
}
|
|
883
|
-
},
|
|
884
|
-
url: {
|
|
885
|
-
// https://drafts.csswg.org/css-values-3/#urls
|
|
886
|
-
pattern: RegExp("\\burl\\((?:" + b.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
887
|
-
greedy: !0,
|
|
888
|
-
inside: {
|
|
889
|
-
function: /^url/i,
|
|
890
|
-
punctuation: /^\(|\)$/,
|
|
891
|
-
string: {
|
|
892
|
-
pattern: RegExp("^" + b.source + "$"),
|
|
893
|
-
alias: "url"
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
},
|
|
897
|
-
selector: {
|
|
898
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + b.source + ")*(?=\\s*\\{)"),
|
|
899
|
-
lookbehind: !0
|
|
900
|
-
},
|
|
901
|
-
string: {
|
|
902
|
-
pattern: b,
|
|
903
|
-
greedy: !0
|
|
904
|
-
},
|
|
905
|
-
property: {
|
|
906
|
-
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
907
|
-
lookbehind: !0
|
|
908
|
-
},
|
|
909
|
-
important: /!important\b/i,
|
|
910
|
-
function: {
|
|
911
|
-
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
912
|
-
lookbehind: !0
|
|
913
|
-
},
|
|
914
|
-
punctuation: /[(){};:,]/
|
|
915
|
-
}, s.languages.css.atrule.inside.rest = s.languages.css;
|
|
916
|
-
var E = s.languages.markup;
|
|
917
|
-
E && (E.tag.addInlined("style", "css"), E.tag.addAttribute("style", "css"));
|
|
918
|
-
})(t), t.languages.clike = {
|
|
919
|
-
comment: [
|
|
920
|
-
{
|
|
921
|
-
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
922
|
-
lookbehind: !0,
|
|
923
|
-
greedy: !0
|
|
924
|
-
},
|
|
925
|
-
{
|
|
926
|
-
pattern: /(^|[^\\:])\/\/.*/,
|
|
927
|
-
lookbehind: !0,
|
|
928
|
-
greedy: !0
|
|
929
|
-
}
|
|
930
|
-
],
|
|
931
|
-
string: {
|
|
932
|
-
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
933
|
-
greedy: !0
|
|
934
|
-
},
|
|
935
|
-
"class-name": {
|
|
936
|
-
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
937
|
-
lookbehind: !0,
|
|
938
|
-
inside: {
|
|
939
|
-
punctuation: /[.\\]/
|
|
940
|
-
}
|
|
941
|
-
},
|
|
942
|
-
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
943
|
-
boolean: /\b(?:false|true)\b/,
|
|
944
|
-
function: /\b\w+(?=\()/,
|
|
945
|
-
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
946
|
-
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
947
|
-
punctuation: /[{}[\];(),.:]/
|
|
948
|
-
}, t.languages.javascript = t.languages.extend("clike", {
|
|
949
|
-
"class-name": [
|
|
950
|
-
t.languages.clike["class-name"],
|
|
951
|
-
{
|
|
952
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
953
|
-
lookbehind: !0
|
|
954
|
-
}
|
|
955
|
-
],
|
|
956
|
-
keyword: [
|
|
957
|
-
{
|
|
958
|
-
pattern: /((?:^|\})\s*)catch\b/,
|
|
959
|
-
lookbehind: !0
|
|
960
|
-
},
|
|
961
|
-
{
|
|
962
|
-
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/,
|
|
963
|
-
lookbehind: !0
|
|
964
|
-
}
|
|
965
|
-
],
|
|
966
|
-
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
|
967
|
-
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
968
|
-
number: {
|
|
969
|
-
pattern: RegExp(
|
|
970
|
-
/(^|[^\w$])/.source + "(?:" + // constant
|
|
971
|
-
(/NaN|Infinity/.source + "|" + // binary integer
|
|
972
|
-
/0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
|
|
973
|
-
/0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
|
|
974
|
-
/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
|
|
975
|
-
/\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
|
|
976
|
-
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
|
|
977
|
-
),
|
|
978
|
-
lookbehind: !0
|
|
979
|
-
},
|
|
980
|
-
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
981
|
-
}), t.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, t.languages.insertBefore("javascript", "keyword", {
|
|
982
|
-
regex: {
|
|
983
|
-
pattern: RegExp(
|
|
984
|
-
// lookbehind
|
|
985
|
-
// eslint-disable-next-line regexp/no-dupe-characters-character-class
|
|
986
|
-
/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
|
|
987
|
-
// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
|
|
988
|
-
// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
|
|
989
|
-
// with the only syntax, so we have to define 2 different regex patterns.
|
|
990
|
-
/\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
|
|
991
|
-
/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
|
|
992
|
-
/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
|
|
993
|
-
),
|
|
994
|
-
lookbehind: !0,
|
|
995
|
-
greedy: !0,
|
|
996
|
-
inside: {
|
|
997
|
-
"regex-source": {
|
|
998
|
-
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
999
|
-
lookbehind: !0,
|
|
1000
|
-
alias: "language-regex",
|
|
1001
|
-
inside: t.languages.regex
|
|
1002
|
-
},
|
|
1003
|
-
"regex-delimiter": /^\/|\/$/,
|
|
1004
|
-
"regex-flags": /^[a-z]+$/
|
|
1005
|
-
}
|
|
1006
|
-
},
|
|
1007
|
-
// This must be declared before keyword because we use "function" inside the look-forward
|
|
1008
|
-
"function-variable": {
|
|
1009
|
-
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*=>))/,
|
|
1010
|
-
alias: "function"
|
|
1011
|
-
},
|
|
1012
|
-
parameter: [
|
|
1013
|
-
{
|
|
1014
|
-
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
1015
|
-
lookbehind: !0,
|
|
1016
|
-
inside: t.languages.javascript
|
|
1017
|
-
},
|
|
1018
|
-
{
|
|
1019
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
1020
|
-
lookbehind: !0,
|
|
1021
|
-
inside: t.languages.javascript
|
|
1022
|
-
},
|
|
1023
|
-
{
|
|
1024
|
-
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
1025
|
-
lookbehind: !0,
|
|
1026
|
-
inside: t.languages.javascript
|
|
1027
|
-
},
|
|
1028
|
-
{
|
|
1029
|
-
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*\{)/,
|
|
1030
|
-
lookbehind: !0,
|
|
1031
|
-
inside: t.languages.javascript
|
|
1032
|
-
}
|
|
1033
|
-
],
|
|
1034
|
-
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
1035
|
-
}), t.languages.insertBefore("javascript", "string", {
|
|
1036
|
-
hashbang: {
|
|
1037
|
-
pattern: /^#!.*/,
|
|
1038
|
-
greedy: !0,
|
|
1039
|
-
alias: "comment"
|
|
1040
|
-
},
|
|
1041
|
-
"template-string": {
|
|
1042
|
-
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
1043
|
-
greedy: !0,
|
|
1044
|
-
inside: {
|
|
1045
|
-
"template-punctuation": {
|
|
1046
|
-
pattern: /^`|`$/,
|
|
1047
|
-
alias: "string"
|
|
1048
|
-
},
|
|
1049
|
-
interpolation: {
|
|
1050
|
-
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
1051
|
-
lookbehind: !0,
|
|
1052
|
-
inside: {
|
|
1053
|
-
"interpolation-punctuation": {
|
|
1054
|
-
pattern: /^\$\{|\}$/,
|
|
1055
|
-
alias: "punctuation"
|
|
1056
|
-
},
|
|
1057
|
-
rest: t.languages.javascript
|
|
1058
|
-
}
|
|
1059
|
-
},
|
|
1060
|
-
string: /[\s\S]+/
|
|
1061
|
-
}
|
|
1062
|
-
},
|
|
1063
|
-
"string-property": {
|
|
1064
|
-
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
1065
|
-
lookbehind: !0,
|
|
1066
|
-
greedy: !0,
|
|
1067
|
-
alias: "property"
|
|
1068
|
-
}
|
|
1069
|
-
}), t.languages.insertBefore("javascript", "operator", {
|
|
1070
|
-
"literal-property": {
|
|
1071
|
-
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
1072
|
-
lookbehind: !0,
|
|
1073
|
-
alias: "property"
|
|
1074
|
-
}
|
|
1075
|
-
}), t.languages.markup && (t.languages.markup.tag.addInlined("script", "javascript"), t.languages.markup.tag.addAttribute(
|
|
1076
|
-
/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,
|
|
1077
|
-
"javascript"
|
|
1078
|
-
)), t.languages.js = t.languages.javascript, (function() {
|
|
1079
|
-
if (typeof t > "u" || typeof document > "u")
|
|
1080
|
-
return;
|
|
1081
|
-
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1082
|
-
var s = "Loading…", b = function(v, y) {
|
|
1083
|
-
return "✖ Error " + v + " while fetching file: " + y;
|
|
1084
|
-
}, E = "✖ Error: File does not exist or is empty", h = {
|
|
1085
|
-
js: "javascript",
|
|
1086
|
-
py: "python",
|
|
1087
|
-
rb: "ruby",
|
|
1088
|
-
ps1: "powershell",
|
|
1089
|
-
psm1: "powershell",
|
|
1090
|
-
sh: "bash",
|
|
1091
|
-
bat: "batch",
|
|
1092
|
-
h: "c",
|
|
1093
|
-
tex: "latex"
|
|
1094
|
-
}, r = "data-src-status", c = "loading", d = "loaded", m = "failed", p = "pre[data-src]:not([" + r + '="' + d + '"]):not([' + r + '="' + c + '"])';
|
|
1095
|
-
function _(v, y, S) {
|
|
1096
|
-
var a = new XMLHttpRequest();
|
|
1097
|
-
a.open("GET", v, !0), a.onreadystatechange = function() {
|
|
1098
|
-
a.readyState == 4 && (a.status < 400 && a.responseText ? y(a.responseText) : a.status >= 400 ? S(b(a.status, a.statusText)) : S(E));
|
|
1099
|
-
}, a.send(null);
|
|
1100
|
-
}
|
|
1101
|
-
function w(v) {
|
|
1102
|
-
var y = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v || "");
|
|
1103
|
-
if (y) {
|
|
1104
|
-
var S = Number(y[1]), a = y[2], n = y[3];
|
|
1105
|
-
return a ? n ? [S, Number(n)] : [S, void 0] : [S, S];
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
t.hooks.add("before-highlightall", function(v) {
|
|
1109
|
-
v.selector += ", " + p;
|
|
1110
|
-
}), t.hooks.add("before-sanity-check", function(v) {
|
|
1111
|
-
var y = (
|
|
1112
|
-
/** @type {HTMLPreElement} */
|
|
1113
|
-
v.element
|
|
1114
|
-
);
|
|
1115
|
-
if (y.matches(p)) {
|
|
1116
|
-
v.code = "", y.setAttribute(r, c);
|
|
1117
|
-
var S = y.appendChild(document.createElement("CODE"));
|
|
1118
|
-
S.textContent = s;
|
|
1119
|
-
var a = y.getAttribute("data-src"), n = v.language;
|
|
1120
|
-
if (n === "none") {
|
|
1121
|
-
var i = (/\.(\w+)$/.exec(a) || [, "none"])[1];
|
|
1122
|
-
n = h[i] || i;
|
|
1123
|
-
}
|
|
1124
|
-
t.util.setLanguage(S, n), t.util.setLanguage(y, n);
|
|
1125
|
-
var u = t.plugins.autoloader;
|
|
1126
|
-
u && u.loadLanguages(n), _(
|
|
1127
|
-
a,
|
|
1128
|
-
function(l) {
|
|
1129
|
-
y.setAttribute(r, d);
|
|
1130
|
-
var f = w(y.getAttribute("data-range"));
|
|
1131
|
-
if (f) {
|
|
1132
|
-
var A = l.split(/\r\n?|\n/g), g = f[0], k = f[1] == null ? A.length : f[1];
|
|
1133
|
-
g < 0 && (g += A.length), g = Math.max(0, Math.min(g - 1, A.length)), k < 0 && (k += A.length), k = Math.max(0, Math.min(k, A.length)), l = A.slice(g, k).join(`
|
|
1134
|
-
`), y.hasAttribute("data-start") || y.setAttribute("data-start", String(g + 1));
|
|
1135
|
-
}
|
|
1136
|
-
S.textContent = l, t.highlightElement(S);
|
|
1137
|
-
},
|
|
1138
|
-
function(l) {
|
|
1139
|
-
y.setAttribute(r, m), S.textContent = l;
|
|
1140
|
-
}
|
|
1141
|
-
);
|
|
1142
|
-
}
|
|
1143
|
-
}), t.plugins.fileHighlight = {
|
|
1144
|
-
/**
|
|
1145
|
-
* Executes the File Highlight plugin for all matching `pre` elements under the given container.
|
|
1146
|
-
*
|
|
1147
|
-
* Note: Elements which are already loaded or currently loading will not be touched by this method.
|
|
1148
|
-
*
|
|
1149
|
-
* @param {ParentNode} [container=document]
|
|
1150
|
-
*/
|
|
1151
|
-
highlight: function(y) {
|
|
1152
|
-
for (var S = (y || document).querySelectorAll(p), a = 0, n; n = S[a++]; )
|
|
1153
|
-
t.highlightElement(n);
|
|
1154
|
-
}
|
|
1155
|
-
};
|
|
1156
|
-
var x = !1;
|
|
1157
|
-
t.fileHighlight = function() {
|
|
1158
|
-
x || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), x = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1159
|
-
};
|
|
1160
|
-
})();
|
|
1161
|
-
})(V)), V.exports;
|
|
1162
|
-
}
|
|
1163
|
-
var Re = Fe();
|
|
1164
|
-
const H = /* @__PURE__ */ xe(Re);
|
|
1165
|
-
var ne = {}, re;
|
|
1166
|
-
function Ie() {
|
|
1167
|
-
return re || (re = 1, (function(e) {
|
|
1168
|
-
e.languages.typescript = e.languages.extend("javascript", {
|
|
1169
|
-
"class-name": {
|
|
1170
|
-
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
|
|
1171
|
-
lookbehind: !0,
|
|
1172
|
-
greedy: !0,
|
|
1173
|
-
inside: null
|
|
1174
|
-
// see below
|
|
1175
|
-
},
|
|
1176
|
-
builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/
|
|
1177
|
-
}), e.languages.typescript.keyword.push(
|
|
1178
|
-
/\b(?:abstract|declare|is|keyof|readonly|require)\b/,
|
|
1179
|
-
// keywords that have to be followed by an identifier
|
|
1180
|
-
/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
|
|
1181
|
-
// This is for `import type *, {}`
|
|
1182
|
-
/\btype\b(?=\s*(?:[\{*]|$))/
|
|
1183
|
-
), delete e.languages.typescript.parameter, delete e.languages.typescript["literal-property"];
|
|
1184
|
-
var o = e.languages.extend("typescript", {});
|
|
1185
|
-
delete o["class-name"], e.languages.typescript["class-name"].inside = o, e.languages.insertBefore("typescript", "function", {
|
|
1186
|
-
decorator: {
|
|
1187
|
-
pattern: /@[$\w\xA0-\uFFFF]+/,
|
|
1188
|
-
inside: {
|
|
1189
|
-
at: {
|
|
1190
|
-
pattern: /^@/,
|
|
1191
|
-
alias: "operator"
|
|
1192
|
-
},
|
|
1193
|
-
function: /^[\s\S]+/
|
|
1194
|
-
}
|
|
1195
|
-
},
|
|
1196
|
-
"generic-function": {
|
|
1197
|
-
// e.g. foo<T extends "bar" | "baz">( ...
|
|
1198
|
-
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
|
|
1199
|
-
greedy: !0,
|
|
1200
|
-
inside: {
|
|
1201
|
-
function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
|
|
1202
|
-
generic: {
|
|
1203
|
-
pattern: /<[\s\S]+/,
|
|
1204
|
-
// everything after the first <
|
|
1205
|
-
alias: "class-name",
|
|
1206
|
-
inside: o
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
}), e.languages.ts = e.languages.typescript;
|
|
1211
|
-
})(Prism)), ne;
|
|
1212
|
-
}
|
|
1213
|
-
Ie();
|
|
1214
|
-
Prism.languages.javascript = Prism.languages.extend("clike", {
|
|
1215
|
-
"class-name": [
|
|
1216
|
-
Prism.languages.clike["class-name"],
|
|
1217
|
-
{
|
|
1218
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
1219
|
-
lookbehind: !0
|
|
1220
|
-
}
|
|
1221
|
-
],
|
|
1222
|
-
keyword: [
|
|
1223
|
-
{
|
|
1224
|
-
pattern: /((?:^|\})\s*)catch\b/,
|
|
1225
|
-
lookbehind: !0
|
|
1226
|
-
},
|
|
1227
|
-
{
|
|
1228
|
-
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/,
|
|
1229
|
-
lookbehind: !0
|
|
1230
|
-
}
|
|
1231
|
-
],
|
|
1232
|
-
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
|
1233
|
-
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
1234
|
-
number: {
|
|
1235
|
-
pattern: RegExp(
|
|
1236
|
-
/(^|[^\w$])/.source + "(?:" + // constant
|
|
1237
|
-
(/NaN|Infinity/.source + "|" + // binary integer
|
|
1238
|
-
/0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
|
|
1239
|
-
/0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
|
|
1240
|
-
/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
|
|
1241
|
-
/\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
|
|
1242
|
-
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
|
|
1243
|
-
),
|
|
1244
|
-
lookbehind: !0
|
|
1245
|
-
},
|
|
1246
|
-
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
1247
|
-
});
|
|
1248
|
-
Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
|
|
1249
|
-
Prism.languages.insertBefore("javascript", "keyword", {
|
|
1250
|
-
regex: {
|
|
1251
|
-
pattern: RegExp(
|
|
1252
|
-
// lookbehind
|
|
1253
|
-
// eslint-disable-next-line regexp/no-dupe-characters-character-class
|
|
1254
|
-
/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
|
|
1255
|
-
// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
|
|
1256
|
-
// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
|
|
1257
|
-
// with the only syntax, so we have to define 2 different regex patterns.
|
|
1258
|
-
/\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
|
|
1259
|
-
/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
|
|
1260
|
-
/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
|
|
1261
|
-
),
|
|
1262
|
-
lookbehind: !0,
|
|
1263
|
-
greedy: !0,
|
|
1264
|
-
inside: {
|
|
1265
|
-
"regex-source": {
|
|
1266
|
-
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
1267
|
-
lookbehind: !0,
|
|
1268
|
-
alias: "language-regex",
|
|
1269
|
-
inside: Prism.languages.regex
|
|
1270
|
-
},
|
|
1271
|
-
"regex-delimiter": /^\/|\/$/,
|
|
1272
|
-
"regex-flags": /^[a-z]+$/
|
|
1273
|
-
}
|
|
1274
|
-
},
|
|
1275
|
-
// This must be declared before keyword because we use "function" inside the look-forward
|
|
1276
|
-
"function-variable": {
|
|
1277
|
-
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*=>))/,
|
|
1278
|
-
alias: "function"
|
|
1279
|
-
},
|
|
1280
|
-
parameter: [
|
|
1281
|
-
{
|
|
1282
|
-
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
1283
|
-
lookbehind: !0,
|
|
1284
|
-
inside: Prism.languages.javascript
|
|
1285
|
-
},
|
|
1286
|
-
{
|
|
1287
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
1288
|
-
lookbehind: !0,
|
|
1289
|
-
inside: Prism.languages.javascript
|
|
1290
|
-
},
|
|
1291
|
-
{
|
|
1292
|
-
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
1293
|
-
lookbehind: !0,
|
|
1294
|
-
inside: Prism.languages.javascript
|
|
1295
|
-
},
|
|
1296
|
-
{
|
|
1297
|
-
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*\{)/,
|
|
1298
|
-
lookbehind: !0,
|
|
1299
|
-
inside: Prism.languages.javascript
|
|
1300
|
-
}
|
|
1301
|
-
],
|
|
1302
|
-
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
1303
|
-
});
|
|
1304
|
-
Prism.languages.insertBefore("javascript", "string", {
|
|
1305
|
-
hashbang: {
|
|
1306
|
-
pattern: /^#!.*/,
|
|
1307
|
-
greedy: !0,
|
|
1308
|
-
alias: "comment"
|
|
1309
|
-
},
|
|
1310
|
-
"template-string": {
|
|
1311
|
-
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
1312
|
-
greedy: !0,
|
|
1313
|
-
inside: {
|
|
1314
|
-
"template-punctuation": {
|
|
1315
|
-
pattern: /^`|`$/,
|
|
1316
|
-
alias: "string"
|
|
1317
|
-
},
|
|
1318
|
-
interpolation: {
|
|
1319
|
-
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
1320
|
-
lookbehind: !0,
|
|
1321
|
-
inside: {
|
|
1322
|
-
"interpolation-punctuation": {
|
|
1323
|
-
pattern: /^\$\{|\}$/,
|
|
1324
|
-
alias: "punctuation"
|
|
1325
|
-
},
|
|
1326
|
-
rest: Prism.languages.javascript
|
|
1327
|
-
}
|
|
1328
|
-
},
|
|
1329
|
-
string: /[\s\S]+/
|
|
1330
|
-
}
|
|
1331
|
-
},
|
|
1332
|
-
"string-property": {
|
|
1333
|
-
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
1334
|
-
lookbehind: !0,
|
|
1335
|
-
greedy: !0,
|
|
1336
|
-
alias: "property"
|
|
1337
|
-
}
|
|
1338
|
-
});
|
|
1339
|
-
Prism.languages.insertBefore("javascript", "operator", {
|
|
1340
|
-
"literal-property": {
|
|
1341
|
-
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
1342
|
-
lookbehind: !0,
|
|
1343
|
-
alias: "property"
|
|
1344
|
-
}
|
|
1345
|
-
});
|
|
1346
|
-
Prism.languages.markup && (Prism.languages.markup.tag.addInlined("script", "javascript"), Prism.languages.markup.tag.addAttribute(
|
|
1347
|
-
/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,
|
|
1348
|
-
"javascript"
|
|
1349
|
-
));
|
|
1350
|
-
Prism.languages.js = Prism.languages.javascript;
|
|
1351
|
-
(function(e) {
|
|
1352
|
-
var o = e.util.clone(e.languages.javascript), t = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source, s = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source, b = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
|
|
1353
|
-
function E(c, d) {
|
|
1354
|
-
return c = c.replace(/<S>/g, function() {
|
|
1355
|
-
return t;
|
|
1356
|
-
}).replace(/<BRACES>/g, function() {
|
|
1357
|
-
return s;
|
|
1358
|
-
}).replace(/<SPREAD>/g, function() {
|
|
1359
|
-
return b;
|
|
1360
|
-
}), RegExp(c, d);
|
|
1361
|
-
}
|
|
1362
|
-
b = E(b).source, e.languages.jsx = e.languages.extend("markup", o), e.languages.jsx.tag.pattern = E(
|
|
1363
|
-
/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source
|
|
1364
|
-
), e.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/, e.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/, e.languages.jsx.tag.inside.tag.inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/, e.languages.jsx.tag.inside.comment = o.comment, e.languages.insertBefore("inside", "attr-name", {
|
|
1365
|
-
spread: {
|
|
1366
|
-
pattern: E(/<SPREAD>/.source),
|
|
1367
|
-
inside: e.languages.jsx
|
|
1368
|
-
}
|
|
1369
|
-
}, e.languages.jsx.tag), e.languages.insertBefore("inside", "special-attr", {
|
|
1370
|
-
script: {
|
|
1371
|
-
// Allow for two levels of nesting
|
|
1372
|
-
pattern: E(/=<BRACES>/.source),
|
|
1373
|
-
alias: "language-javascript",
|
|
1374
|
-
inside: {
|
|
1375
|
-
"script-punctuation": {
|
|
1376
|
-
pattern: /^=(?=\{)/,
|
|
1377
|
-
alias: "punctuation"
|
|
1378
|
-
},
|
|
1379
|
-
rest: e.languages.jsx
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
}, e.languages.jsx.tag);
|
|
1383
|
-
var h = function(c) {
|
|
1384
|
-
return c ? typeof c == "string" ? c : typeof c.content == "string" ? c.content : c.content.map(h).join("") : "";
|
|
1385
|
-
}, r = function(c) {
|
|
1386
|
-
for (var d = [], m = 0; m < c.length; m++) {
|
|
1387
|
-
var p = c[m], _ = !1;
|
|
1388
|
-
if (typeof p != "string" && (p.type === "tag" && p.content[0] && p.content[0].type === "tag" ? p.content[0].content[0].content === "</" ? d.length > 0 && d[d.length - 1].tagName === h(p.content[0].content[1]) && d.pop() : p.content[p.content.length - 1].content === "/>" || d.push({
|
|
1389
|
-
tagName: h(p.content[0].content[1]),
|
|
1390
|
-
openedBraces: 0
|
|
1391
|
-
}) : d.length > 0 && p.type === "punctuation" && p.content === "{" ? d[d.length - 1].openedBraces++ : d.length > 0 && d[d.length - 1].openedBraces > 0 && p.type === "punctuation" && p.content === "}" ? d[d.length - 1].openedBraces-- : _ = !0), (_ || typeof p == "string") && d.length > 0 && d[d.length - 1].openedBraces === 0) {
|
|
1392
|
-
var w = h(p);
|
|
1393
|
-
m < c.length - 1 && (typeof c[m + 1] == "string" || c[m + 1].type === "plain-text") && (w += h(c[m + 1]), c.splice(m + 1, 1)), m > 0 && (typeof c[m - 1] == "string" || c[m - 1].type === "plain-text") && (w = h(c[m - 1]) + w, c.splice(m - 1, 1), m--), c[m] = new e.Token("plain-text", w, null, w);
|
|
1394
|
-
}
|
|
1395
|
-
p.content && typeof p.content != "string" && r(p.content);
|
|
1396
|
-
}
|
|
1397
|
-
};
|
|
1398
|
-
e.hooks.add("after-tokenize", function(c) {
|
|
1399
|
-
c.language !== "jsx" && c.language !== "tsx" || r(c.tokens);
|
|
1400
|
-
});
|
|
1401
|
-
})(Prism);
|
|
1402
|
-
(function(e) {
|
|
1403
|
-
var o = e.util.clone(e.languages.typescript);
|
|
1404
|
-
e.languages.tsx = e.languages.extend("jsx", o), delete e.languages.tsx.parameter, delete e.languages.tsx["literal-property"];
|
|
1405
|
-
var t = e.languages.tsx.tag;
|
|
1406
|
-
t.pattern = RegExp(/(^|[^\w$]|(?=<\/))/.source + "(?:" + t.pattern.source + ")", t.pattern.flags), t.lookbehind = !0;
|
|
1407
|
-
})(Prism);
|
|
1408
|
-
Prism.languages.json = {
|
|
1409
|
-
property: {
|
|
1410
|
-
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
1411
|
-
lookbehind: !0,
|
|
1412
|
-
greedy: !0
|
|
1413
|
-
},
|
|
1414
|
-
string: {
|
|
1415
|
-
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
|
|
1416
|
-
lookbehind: !0,
|
|
1417
|
-
greedy: !0
|
|
1418
|
-
},
|
|
1419
|
-
comment: {
|
|
1420
|
-
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
1421
|
-
greedy: !0
|
|
1422
|
-
},
|
|
1423
|
-
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
1424
|
-
punctuation: /[{}[\],]/,
|
|
1425
|
-
operator: /:/,
|
|
1426
|
-
boolean: /\b(?:false|true)\b/,
|
|
1427
|
-
null: {
|
|
1428
|
-
pattern: /\bnull\b/,
|
|
1429
|
-
alias: "keyword"
|
|
1430
|
-
}
|
|
1431
|
-
};
|
|
1432
|
-
Prism.languages.webmanifest = Prism.languages.json;
|
|
1433
|
-
var se = {}, ie;
|
|
1434
|
-
function Ne() {
|
|
1435
|
-
return ie || (ie = 1, Prism.languages.python = {
|
|
1436
|
-
comment: {
|
|
1437
|
-
pattern: /(^|[^\\])#.*/,
|
|
1438
|
-
lookbehind: !0,
|
|
1439
|
-
greedy: !0
|
|
1440
|
-
},
|
|
1441
|
-
"string-interpolation": {
|
|
1442
|
-
pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
|
|
1443
|
-
greedy: !0,
|
|
1444
|
-
inside: {
|
|
1445
|
-
interpolation: {
|
|
1446
|
-
// "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
|
|
1447
|
-
pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
|
|
1448
|
-
lookbehind: !0,
|
|
1449
|
-
inside: {
|
|
1450
|
-
"format-spec": {
|
|
1451
|
-
pattern: /(:)[^:(){}]+(?=\}$)/,
|
|
1452
|
-
lookbehind: !0
|
|
1453
|
-
},
|
|
1454
|
-
"conversion-option": {
|
|
1455
|
-
pattern: //,
|
|
1456
|
-
alias: "punctuation"
|
|
1457
|
-
},
|
|
1458
|
-
rest: null
|
|
1459
|
-
}
|
|
1460
|
-
},
|
|
1461
|
-
string: /[\s\S]+/
|
|
1462
|
-
}
|
|
1463
|
-
},
|
|
1464
|
-
"triple-quoted-string": {
|
|
1465
|
-
pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
|
|
1466
|
-
greedy: !0,
|
|
1467
|
-
alias: "string"
|
|
1468
|
-
},
|
|
1469
|
-
string: {
|
|
1470
|
-
pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
|
|
1471
|
-
greedy: !0
|
|
1472
|
-
},
|
|
1473
|
-
function: {
|
|
1474
|
-
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
|
|
1475
|
-
lookbehind: !0
|
|
1476
|
-
},
|
|
1477
|
-
"class-name": {
|
|
1478
|
-
pattern: /(\bclass\s+)\w+/i,
|
|
1479
|
-
lookbehind: !0
|
|
1480
|
-
},
|
|
1481
|
-
decorator: {
|
|
1482
|
-
pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
|
|
1483
|
-
lookbehind: !0,
|
|
1484
|
-
alias: ["annotation", "punctuation"],
|
|
1485
|
-
inside: {
|
|
1486
|
-
punctuation: /\./
|
|
1487
|
-
}
|
|
1488
|
-
},
|
|
1489
|
-
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/,
|
|
1490
|
-
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/,
|
|
1491
|
-
boolean: /\b(?:False|None|True)\b/,
|
|
1492
|
-
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,
|
|
1493
|
-
operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
|
|
1494
|
-
punctuation: /[{}[\];(),.:]/
|
|
1495
|
-
}, Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python, Prism.languages.py = Prism.languages.python), se;
|
|
1496
|
-
}
|
|
1497
|
-
Ne();
|
|
1498
|
-
(function(e) {
|
|
1499
|
-
var o = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", t = {
|
|
1500
|
-
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
1501
|
-
lookbehind: !0,
|
|
1502
|
-
alias: "punctuation",
|
|
1503
|
-
// this looks reasonably well in all themes
|
|
1504
|
-
inside: null
|
|
1505
|
-
// see below
|
|
1506
|
-
}, s = {
|
|
1507
|
-
bash: t,
|
|
1508
|
-
environment: {
|
|
1509
|
-
pattern: RegExp("\\$" + o),
|
|
1510
|
-
alias: "constant"
|
|
1511
|
-
},
|
|
1512
|
-
variable: [
|
|
1513
|
-
// [0]: Arithmetic Environment
|
|
1514
|
-
{
|
|
1515
|
-
pattern: /\$?\(\([\s\S]+?\)\)/,
|
|
1516
|
-
greedy: !0,
|
|
1517
|
-
inside: {
|
|
1518
|
-
// If there is a $ sign at the beginning highlight $(( and )) as variable
|
|
1519
|
-
variable: [
|
|
1520
|
-
{
|
|
1521
|
-
pattern: /(^\$\(\([\s\S]+)\)\)/,
|
|
1522
|
-
lookbehind: !0
|
|
1523
|
-
},
|
|
1524
|
-
/^\$\(\(/
|
|
1525
|
-
],
|
|
1526
|
-
number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
|
|
1527
|
-
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
|
|
1528
|
-
operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
|
|
1529
|
-
// If there is no $ sign at the beginning highlight (( and )) as punctuation
|
|
1530
|
-
punctuation: /\(\(?|\)\)?|,|;/
|
|
1531
|
-
}
|
|
1532
|
-
},
|
|
1533
|
-
// [1]: Command Substitution
|
|
1534
|
-
{
|
|
1535
|
-
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
|
|
1536
|
-
greedy: !0,
|
|
1537
|
-
inside: {
|
|
1538
|
-
variable: /^\$\(|^`|\)$|`$/
|
|
1539
|
-
}
|
|
1540
|
-
},
|
|
1541
|
-
// [2]: Brace expansion
|
|
1542
|
-
{
|
|
1543
|
-
pattern: /\$\{[^}]+\}/,
|
|
1544
|
-
greedy: !0,
|
|
1545
|
-
inside: {
|
|
1546
|
-
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
1547
|
-
punctuation: /[\[\]]/,
|
|
1548
|
-
environment: {
|
|
1549
|
-
pattern: RegExp("(\\{)" + o),
|
|
1550
|
-
lookbehind: !0,
|
|
1551
|
-
alias: "constant"
|
|
1552
|
-
}
|
|
1553
|
-
}
|
|
1554
|
-
},
|
|
1555
|
-
/\$(?:\w+|[#?*!@$])/
|
|
1556
|
-
],
|
|
1557
|
-
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
1558
|
-
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
1559
|
-
};
|
|
1560
|
-
e.languages.bash = {
|
|
1561
|
-
shebang: {
|
|
1562
|
-
pattern: /^#!\s*\/.*/,
|
|
1563
|
-
alias: "important"
|
|
1564
|
-
},
|
|
1565
|
-
comment: {
|
|
1566
|
-
pattern: /(^|[^"{\\$])#.*/,
|
|
1567
|
-
lookbehind: !0
|
|
1568
|
-
},
|
|
1569
|
-
"function-name": [
|
|
1570
|
-
// a) function foo {
|
|
1571
|
-
// b) foo() {
|
|
1572
|
-
// c) function foo() {
|
|
1573
|
-
// but not “foo {”
|
|
1574
|
-
{
|
|
1575
|
-
// a) and c)
|
|
1576
|
-
pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
|
|
1577
|
-
lookbehind: !0,
|
|
1578
|
-
alias: "function"
|
|
1579
|
-
},
|
|
1580
|
-
{
|
|
1581
|
-
// b)
|
|
1582
|
-
pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
|
|
1583
|
-
alias: "function"
|
|
1584
|
-
}
|
|
1585
|
-
],
|
|
1586
|
-
// Highlight variable names as variables in for and select beginnings.
|
|
1587
|
-
"for-or-select": {
|
|
1588
|
-
pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
|
|
1589
|
-
alias: "variable",
|
|
1590
|
-
lookbehind: !0
|
|
1591
|
-
},
|
|
1592
|
-
// Highlight variable names as variables in the left-hand part
|
|
1593
|
-
// of assignments (“=” and “+=”).
|
|
1594
|
-
"assign-left": {
|
|
1595
|
-
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
|
1596
|
-
inside: {
|
|
1597
|
-
environment: {
|
|
1598
|
-
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + o),
|
|
1599
|
-
lookbehind: !0,
|
|
1600
|
-
alias: "constant"
|
|
1601
|
-
}
|
|
1602
|
-
},
|
|
1603
|
-
alias: "variable",
|
|
1604
|
-
lookbehind: !0
|
|
1605
|
-
},
|
|
1606
|
-
// Highlight parameter names as variables
|
|
1607
|
-
parameter: {
|
|
1608
|
-
pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
|
|
1609
|
-
alias: "variable",
|
|
1610
|
-
lookbehind: !0
|
|
1611
|
-
},
|
|
1612
|
-
string: [
|
|
1613
|
-
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
|
|
1614
|
-
{
|
|
1615
|
-
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
1616
|
-
lookbehind: !0,
|
|
1617
|
-
greedy: !0,
|
|
1618
|
-
inside: s
|
|
1619
|
-
},
|
|
1620
|
-
// Here-document with quotes around the tag
|
|
1621
|
-
// → No expansion (so no “inside”).
|
|
1622
|
-
{
|
|
1623
|
-
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
|
|
1624
|
-
lookbehind: !0,
|
|
1625
|
-
greedy: !0,
|
|
1626
|
-
inside: {
|
|
1627
|
-
bash: t
|
|
1628
|
-
}
|
|
1629
|
-
},
|
|
1630
|
-
// “Normal” string
|
|
1631
|
-
{
|
|
1632
|
-
// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
|
|
1633
|
-
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
1634
|
-
lookbehind: !0,
|
|
1635
|
-
greedy: !0,
|
|
1636
|
-
inside: s
|
|
1637
|
-
},
|
|
1638
|
-
{
|
|
1639
|
-
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
1640
|
-
pattern: /(^|[^$\\])'[^']*'/,
|
|
1641
|
-
lookbehind: !0,
|
|
1642
|
-
greedy: !0
|
|
1643
|
-
},
|
|
1644
|
-
{
|
|
1645
|
-
// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
|
|
1646
|
-
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
1647
|
-
greedy: !0,
|
|
1648
|
-
inside: {
|
|
1649
|
-
entity: s.entity
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
],
|
|
1653
|
-
environment: {
|
|
1654
|
-
pattern: RegExp("\\$?" + o),
|
|
1655
|
-
alias: "constant"
|
|
1656
|
-
},
|
|
1657
|
-
variable: s.variable,
|
|
1658
|
-
function: {
|
|
1659
|
-
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
|
1660
|
-
lookbehind: !0
|
|
1661
|
-
},
|
|
1662
|
-
keyword: {
|
|
1663
|
-
pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
|
|
1664
|
-
lookbehind: !0
|
|
1665
|
-
},
|
|
1666
|
-
// https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
|
|
1667
|
-
builtin: {
|
|
1668
|
-
pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
|
|
1669
|
-
lookbehind: !0,
|
|
1670
|
-
// Alias added to make those easier to distinguish from strings.
|
|
1671
|
-
alias: "class-name"
|
|
1672
|
-
},
|
|
1673
|
-
boolean: {
|
|
1674
|
-
pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
|
|
1675
|
-
lookbehind: !0
|
|
1676
|
-
},
|
|
1677
|
-
"file-descriptor": {
|
|
1678
|
-
pattern: /\B&\d\b/,
|
|
1679
|
-
alias: "important"
|
|
1680
|
-
},
|
|
1681
|
-
operator: {
|
|
1682
|
-
// Lots of redirections here, but not just that.
|
|
1683
|
-
pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
|
|
1684
|
-
inside: {
|
|
1685
|
-
"file-descriptor": {
|
|
1686
|
-
pattern: /^\d/,
|
|
1687
|
-
alias: "important"
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
},
|
|
1691
|
-
punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
|
|
1692
|
-
number: {
|
|
1693
|
-
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
1694
|
-
lookbehind: !0
|
|
1695
|
-
}
|
|
1696
|
-
}, t.inside = e.languages.bash;
|
|
1697
|
-
for (var b = [
|
|
1698
|
-
"comment",
|
|
1699
|
-
"function-name",
|
|
1700
|
-
"for-or-select",
|
|
1701
|
-
"assign-left",
|
|
1702
|
-
"parameter",
|
|
1703
|
-
"string",
|
|
1704
|
-
"environment",
|
|
1705
|
-
"function",
|
|
1706
|
-
"keyword",
|
|
1707
|
-
"builtin",
|
|
1708
|
-
"boolean",
|
|
1709
|
-
"file-descriptor",
|
|
1710
|
-
"operator",
|
|
1711
|
-
"punctuation",
|
|
1712
|
-
"number"
|
|
1713
|
-
], E = s.variable[1].inside, h = 0; h < b.length; h++)
|
|
1714
|
-
E[b[h]] = e.languages.bash[b[h]];
|
|
1715
|
-
e.languages.sh = e.languages.bash, e.languages.shell = e.languages.bash;
|
|
1716
|
-
})(Prism);
|
|
1717
|
-
Prism.languages.markup = {
|
|
1718
|
-
comment: {
|
|
1719
|
-
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
1720
|
-
greedy: !0
|
|
1721
|
-
},
|
|
1722
|
-
prolog: {
|
|
1723
|
-
pattern: /<\?[\s\S]+?\?>/,
|
|
1724
|
-
greedy: !0
|
|
1725
|
-
},
|
|
1726
|
-
doctype: {
|
|
1727
|
-
// https://www.w3.org/TR/xml/#NT-doctypedecl
|
|
1728
|
-
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
|
1729
|
-
greedy: !0,
|
|
1730
|
-
inside: {
|
|
1731
|
-
"internal-subset": {
|
|
1732
|
-
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
|
1733
|
-
lookbehind: !0,
|
|
1734
|
-
greedy: !0,
|
|
1735
|
-
inside: null
|
|
1736
|
-
// see below
|
|
1737
|
-
},
|
|
1738
|
-
string: {
|
|
1739
|
-
pattern: /"[^"]*"|'[^']*'/,
|
|
1740
|
-
greedy: !0
|
|
1741
|
-
},
|
|
1742
|
-
punctuation: /^<!|>$|[[\]]/,
|
|
1743
|
-
"doctype-tag": /^DOCTYPE/i,
|
|
1744
|
-
name: /[^\s<>'"]+/
|
|
1745
|
-
}
|
|
1746
|
-
},
|
|
1747
|
-
cdata: {
|
|
1748
|
-
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1749
|
-
greedy: !0
|
|
1750
|
-
},
|
|
1751
|
-
tag: {
|
|
1752
|
-
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
|
1753
|
-
greedy: !0,
|
|
1754
|
-
inside: {
|
|
1755
|
-
tag: {
|
|
1756
|
-
pattern: /^<\/?[^\s>\/]+/,
|
|
1757
|
-
inside: {
|
|
1758
|
-
punctuation: /^<\/?/,
|
|
1759
|
-
namespace: /^[^\s>\/:]+:/
|
|
1760
|
-
}
|
|
1761
|
-
},
|
|
1762
|
-
"special-attr": [],
|
|
1763
|
-
"attr-value": {
|
|
1764
|
-
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
|
|
1765
|
-
inside: {
|
|
1766
|
-
punctuation: [
|
|
1767
|
-
{
|
|
1768
|
-
pattern: /^=/,
|
|
1769
|
-
alias: "attr-equals"
|
|
1770
|
-
},
|
|
1771
|
-
{
|
|
1772
|
-
pattern: /^(\s*)["']|["']$/,
|
|
1773
|
-
lookbehind: !0
|
|
1774
|
-
}
|
|
1775
|
-
]
|
|
1776
|
-
}
|
|
1777
|
-
},
|
|
1778
|
-
punctuation: /\/?>/,
|
|
1779
|
-
"attr-name": {
|
|
1780
|
-
pattern: /[^\s>\/]+/,
|
|
1781
|
-
inside: {
|
|
1782
|
-
namespace: /^[^\s>\/:]+:/
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
}
|
|
1786
|
-
},
|
|
1787
|
-
entity: [
|
|
1788
|
-
{
|
|
1789
|
-
pattern: /&[\da-z]{1,8};/i,
|
|
1790
|
-
alias: "named-entity"
|
|
1791
|
-
},
|
|
1792
|
-
/&#x?[\da-f]{1,8};/i
|
|
1793
|
-
]
|
|
1794
|
-
};
|
|
1795
|
-
Prism.languages.markup.tag.inside["attr-value"].inside.entity = Prism.languages.markup.entity;
|
|
1796
|
-
Prism.languages.markup.doctype.inside["internal-subset"].inside = Prism.languages.markup;
|
|
1797
|
-
Prism.hooks.add("wrap", function(e) {
|
|
1798
|
-
e.type === "entity" && (e.attributes.title = e.content.replace(/&/, "&"));
|
|
1799
|
-
});
|
|
1800
|
-
Object.defineProperty(Prism.languages.markup.tag, "addInlined", {
|
|
1801
|
-
/**
|
|
1802
|
-
* Adds an inlined language to markup.
|
|
1803
|
-
*
|
|
1804
|
-
* An example of an inlined language is CSS with `<style>` tags.
|
|
1805
|
-
*
|
|
1806
|
-
* @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
|
|
1807
|
-
* case insensitive.
|
|
1808
|
-
* @param {string} lang The language key.
|
|
1809
|
-
* @example
|
|
1810
|
-
* addInlined('style', 'css');
|
|
1811
|
-
*/
|
|
1812
|
-
value: function(o, t) {
|
|
1813
|
-
var s = {};
|
|
1814
|
-
s["language-" + t] = {
|
|
1815
|
-
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1816
|
-
lookbehind: !0,
|
|
1817
|
-
inside: Prism.languages[t]
|
|
1818
|
-
}, s.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1819
|
-
var b = {
|
|
1820
|
-
"included-cdata": {
|
|
1821
|
-
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1822
|
-
inside: s
|
|
1823
|
-
}
|
|
1824
|
-
};
|
|
1825
|
-
b["language-" + t] = {
|
|
1826
|
-
pattern: /[\s\S]+/,
|
|
1827
|
-
inside: Prism.languages[t]
|
|
1828
|
-
};
|
|
1829
|
-
var E = {};
|
|
1830
|
-
E[o] = {
|
|
1831
|
-
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1832
|
-
return o;
|
|
1833
|
-
}), "i"),
|
|
1834
|
-
lookbehind: !0,
|
|
1835
|
-
greedy: !0,
|
|
1836
|
-
inside: b
|
|
1837
|
-
}, Prism.languages.insertBefore("markup", "cdata", E);
|
|
1838
|
-
}
|
|
1839
|
-
});
|
|
1840
|
-
Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
|
|
1841
|
-
/**
|
|
1842
|
-
* Adds an pattern to highlight languages embedded in HTML attributes.
|
|
1843
|
-
*
|
|
1844
|
-
* An example of an inlined language is CSS with `style` attributes.
|
|
1845
|
-
*
|
|
1846
|
-
* @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
|
|
1847
|
-
* case insensitive.
|
|
1848
|
-
* @param {string} lang The language key.
|
|
1849
|
-
* @example
|
|
1850
|
-
* addAttribute('style', 'css');
|
|
1851
|
-
*/
|
|
1852
|
-
value: function(e, o) {
|
|
1853
|
-
Prism.languages.markup.tag.inside["special-attr"].push({
|
|
1854
|
-
pattern: RegExp(
|
|
1855
|
-
/(^|["'\s])/.source + "(?:" + e + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
1856
|
-
"i"
|
|
1857
|
-
),
|
|
1858
|
-
lookbehind: !0,
|
|
1859
|
-
inside: {
|
|
1860
|
-
"attr-name": /^[^\s=]+/,
|
|
1861
|
-
"attr-value": {
|
|
1862
|
-
pattern: /=[\s\S]+/,
|
|
1863
|
-
inside: {
|
|
1864
|
-
value: {
|
|
1865
|
-
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1866
|
-
lookbehind: !0,
|
|
1867
|
-
alias: [o, "language-" + o],
|
|
1868
|
-
inside: Prism.languages[o]
|
|
1869
|
-
},
|
|
1870
|
-
punctuation: [
|
|
1871
|
-
{
|
|
1872
|
-
pattern: /^=/,
|
|
1873
|
-
alias: "attr-equals"
|
|
1874
|
-
},
|
|
1875
|
-
/"|'/
|
|
1876
|
-
]
|
|
1877
|
-
}
|
|
1878
|
-
}
|
|
1879
|
-
}
|
|
1880
|
-
});
|
|
1881
|
-
}
|
|
1882
|
-
});
|
|
1883
|
-
Prism.languages.html = Prism.languages.markup;
|
|
1884
|
-
Prism.languages.mathml = Prism.languages.markup;
|
|
1885
|
-
Prism.languages.svg = Prism.languages.markup;
|
|
1886
|
-
Prism.languages.xml = Prism.languages.extend("markup", {});
|
|
1887
|
-
Prism.languages.ssml = Prism.languages.xml;
|
|
1888
|
-
Prism.languages.atom = Prism.languages.xml;
|
|
1889
|
-
Prism.languages.rss = Prism.languages.xml;
|
|
1890
|
-
(function(e) {
|
|
1891
|
-
var o = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1892
|
-
e.languages.css = {
|
|
1893
|
-
comment: /\/\*[\s\S]*?\*\//,
|
|
1894
|
-
atrule: {
|
|
1895
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + o.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
1896
|
-
inside: {
|
|
1897
|
-
rule: /^@[\w-]+/,
|
|
1898
|
-
"selector-function-argument": {
|
|
1899
|
-
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
1900
|
-
lookbehind: !0,
|
|
1901
|
-
alias: "selector"
|
|
1902
|
-
},
|
|
1903
|
-
keyword: {
|
|
1904
|
-
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
1905
|
-
lookbehind: !0
|
|
1906
|
-
}
|
|
1907
|
-
// See rest below
|
|
1908
|
-
}
|
|
1909
|
-
},
|
|
1910
|
-
url: {
|
|
1911
|
-
// https://drafts.csswg.org/css-values-3/#urls
|
|
1912
|
-
pattern: RegExp("\\burl\\((?:" + o.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
1913
|
-
greedy: !0,
|
|
1914
|
-
inside: {
|
|
1915
|
-
function: /^url/i,
|
|
1916
|
-
punctuation: /^\(|\)$/,
|
|
1917
|
-
string: {
|
|
1918
|
-
pattern: RegExp("^" + o.source + "$"),
|
|
1919
|
-
alias: "url"
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
},
|
|
1923
|
-
selector: {
|
|
1924
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + o.source + ")*(?=\\s*\\{)"),
|
|
1925
|
-
lookbehind: !0
|
|
1926
|
-
},
|
|
1927
|
-
string: {
|
|
1928
|
-
pattern: o,
|
|
1929
|
-
greedy: !0
|
|
1930
|
-
},
|
|
1931
|
-
property: {
|
|
1932
|
-
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
1933
|
-
lookbehind: !0
|
|
1934
|
-
},
|
|
1935
|
-
important: /!important\b/i,
|
|
1936
|
-
function: {
|
|
1937
|
-
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
1938
|
-
lookbehind: !0
|
|
1939
|
-
},
|
|
1940
|
-
punctuation: /[(){};:,]/
|
|
1941
|
-
}, e.languages.css.atrule.inside.rest = e.languages.css;
|
|
1942
|
-
var t = e.languages.markup;
|
|
1943
|
-
t && (t.tag.addInlined("style", "css"), t.tag.addAttribute("style", "css"));
|
|
1944
|
-
})(Prism);
|
|
1945
|
-
var oe = {}, ue;
|
|
1946
|
-
function Oe() {
|
|
1947
|
-
return ue || (ue = 1, (function(e) {
|
|
1948
|
-
var o = /\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/, t = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, s = {
|
|
1949
|
-
pattern: RegExp(/(^|[^\w.])/.source + t + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
|
|
1950
|
-
lookbehind: !0,
|
|
1951
|
-
inside: {
|
|
1952
|
-
namespace: {
|
|
1953
|
-
pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,
|
|
1954
|
-
inside: {
|
|
1955
|
-
punctuation: /\./
|
|
1956
|
-
}
|
|
1957
|
-
},
|
|
1958
|
-
punctuation: /\./
|
|
1959
|
-
}
|
|
1960
|
-
};
|
|
1961
|
-
e.languages.java = e.languages.extend("clike", {
|
|
1962
|
-
string: {
|
|
1963
|
-
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
|
|
1964
|
-
lookbehind: !0,
|
|
1965
|
-
greedy: !0
|
|
1966
|
-
},
|
|
1967
|
-
"class-name": [
|
|
1968
|
-
s,
|
|
1969
|
-
{
|
|
1970
|
-
// variables, parameters, and constructor references
|
|
1971
|
-
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
|
|
1972
|
-
pattern: RegExp(/(^|[^\w.])/.source + t + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
|
|
1973
|
-
lookbehind: !0,
|
|
1974
|
-
inside: s.inside
|
|
1975
|
-
},
|
|
1976
|
-
{
|
|
1977
|
-
// class names based on keyword
|
|
1978
|
-
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
|
|
1979
|
-
pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + t + /[A-Z]\w*\b/.source),
|
|
1980
|
-
lookbehind: !0,
|
|
1981
|
-
inside: s.inside
|
|
1982
|
-
}
|
|
1983
|
-
],
|
|
1984
|
-
keyword: o,
|
|
1985
|
-
function: [
|
|
1986
|
-
e.languages.clike.function,
|
|
1987
|
-
{
|
|
1988
|
-
pattern: /(::\s*)[a-z_]\w*/,
|
|
1989
|
-
lookbehind: !0
|
|
1990
|
-
}
|
|
1991
|
-
],
|
|
1992
|
-
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,
|
|
1993
|
-
operator: {
|
|
1994
|
-
pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
|
|
1995
|
-
lookbehind: !0
|
|
1996
|
-
},
|
|
1997
|
-
constant: /\b[A-Z][A-Z_\d]+\b/
|
|
1998
|
-
}), e.languages.insertBefore("java", "string", {
|
|
1999
|
-
"triple-quoted-string": {
|
|
2000
|
-
// http://openjdk.java.net/jeps/355#Description
|
|
2001
|
-
pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
|
|
2002
|
-
greedy: !0,
|
|
2003
|
-
alias: "string"
|
|
2004
|
-
},
|
|
2005
|
-
char: {
|
|
2006
|
-
pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
|
|
2007
|
-
greedy: !0
|
|
2008
|
-
}
|
|
2009
|
-
}), e.languages.insertBefore("java", "class-name", {
|
|
2010
|
-
annotation: {
|
|
2011
|
-
pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
|
|
2012
|
-
lookbehind: !0,
|
|
2013
|
-
alias: "punctuation"
|
|
2014
|
-
},
|
|
2015
|
-
generics: {
|
|
2016
|
-
pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
|
|
2017
|
-
inside: {
|
|
2018
|
-
"class-name": s,
|
|
2019
|
-
keyword: o,
|
|
2020
|
-
punctuation: /[<>(),.:]/,
|
|
2021
|
-
operator: /[?&|]/
|
|
2022
|
-
}
|
|
2023
|
-
},
|
|
2024
|
-
import: [
|
|
2025
|
-
{
|
|
2026
|
-
pattern: RegExp(/(\bimport\s+)/.source + t + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
|
|
2027
|
-
lookbehind: !0,
|
|
2028
|
-
inside: {
|
|
2029
|
-
namespace: s.inside.namespace,
|
|
2030
|
-
punctuation: /\./,
|
|
2031
|
-
operator: /\*/,
|
|
2032
|
-
"class-name": /\w+/
|
|
2033
|
-
}
|
|
2034
|
-
},
|
|
2035
|
-
{
|
|
2036
|
-
pattern: RegExp(/(\bimport\s+static\s+)/.source + t + /(?:\w+|\*)(?=\s*;)/.source),
|
|
2037
|
-
lookbehind: !0,
|
|
2038
|
-
alias: "static",
|
|
2039
|
-
inside: {
|
|
2040
|
-
namespace: s.inside.namespace,
|
|
2041
|
-
static: /\b\w+$/,
|
|
2042
|
-
punctuation: /\./,
|
|
2043
|
-
operator: /\*/,
|
|
2044
|
-
"class-name": /\w+/
|
|
2045
|
-
}
|
|
2046
|
-
}
|
|
2047
|
-
],
|
|
2048
|
-
namespace: {
|
|
2049
|
-
pattern: RegExp(
|
|
2050
|
-
/(\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() {
|
|
2051
|
-
return o.source;
|
|
2052
|
-
})
|
|
2053
|
-
),
|
|
2054
|
-
lookbehind: !0,
|
|
2055
|
-
inside: {
|
|
2056
|
-
punctuation: /\./
|
|
2057
|
-
}
|
|
2058
|
-
}
|
|
2059
|
-
});
|
|
2060
|
-
})(Prism)), oe;
|
|
2061
|
-
}
|
|
2062
|
-
Oe();
|
|
2063
|
-
Prism.languages.c = Prism.languages.extend("clike", {
|
|
2064
|
-
comment: {
|
|
2065
|
-
pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
2066
|
-
greedy: !0
|
|
2067
|
-
},
|
|
2068
|
-
string: {
|
|
2069
|
-
// https://en.cppreference.com/w/c/language/string_literal
|
|
2070
|
-
pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
|
|
2071
|
-
greedy: !0
|
|
2072
|
-
},
|
|
2073
|
-
"class-name": {
|
|
2074
|
-
pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
|
|
2075
|
-
lookbehind: !0
|
|
2076
|
-
},
|
|
2077
|
-
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/,
|
|
2078
|
-
function: /\b[a-z_]\w*(?=\s*\()/i,
|
|
2079
|
-
number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
|
|
2080
|
-
operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
|
|
2081
|
-
});
|
|
2082
|
-
Prism.languages.insertBefore("c", "string", {
|
|
2083
|
-
char: {
|
|
2084
|
-
// https://en.cppreference.com/w/c/language/character_constant
|
|
2085
|
-
pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
|
|
2086
|
-
greedy: !0
|
|
2087
|
-
}
|
|
2088
|
-
});
|
|
2089
|
-
Prism.languages.insertBefore("c", "string", {
|
|
2090
|
-
macro: {
|
|
2091
|
-
// allow for multiline macro definitions
|
|
2092
|
-
// spaces after the # character compile fine with gcc
|
|
2093
|
-
pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
|
|
2094
|
-
lookbehind: !0,
|
|
2095
|
-
greedy: !0,
|
|
2096
|
-
alias: "property",
|
|
2097
|
-
inside: {
|
|
2098
|
-
string: [
|
|
2099
|
-
{
|
|
2100
|
-
// highlight the path of the include statement as a string
|
|
2101
|
-
pattern: /^(#\s*include\s*)<[^>]+>/,
|
|
2102
|
-
lookbehind: !0
|
|
2103
|
-
},
|
|
2104
|
-
Prism.languages.c.string
|
|
2105
|
-
],
|
|
2106
|
-
char: Prism.languages.c.char,
|
|
2107
|
-
comment: Prism.languages.c.comment,
|
|
2108
|
-
"macro-name": [
|
|
2109
|
-
{
|
|
2110
|
-
pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
|
|
2111
|
-
lookbehind: !0
|
|
2112
|
-
},
|
|
2113
|
-
{
|
|
2114
|
-
pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
|
|
2115
|
-
lookbehind: !0,
|
|
2116
|
-
alias: "function"
|
|
2117
|
-
}
|
|
2118
|
-
],
|
|
2119
|
-
// highlight macro directives as keywords
|
|
2120
|
-
directive: {
|
|
2121
|
-
pattern: /^(#\s*)[a-z]+/,
|
|
2122
|
-
lookbehind: !0,
|
|
2123
|
-
alias: "keyword"
|
|
2124
|
-
},
|
|
2125
|
-
"directive-hash": /^#/,
|
|
2126
|
-
punctuation: /##|\\(?=[\r\n])/,
|
|
2127
|
-
expression: {
|
|
2128
|
-
pattern: /\S[\s\S]*/,
|
|
2129
|
-
inside: Prism.languages.c
|
|
2130
|
-
}
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
});
|
|
2134
|
-
Prism.languages.insertBefore("c", "function", {
|
|
2135
|
-
// highlight predefined macros as constants
|
|
2136
|
-
constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
|
|
2137
|
-
});
|
|
2138
|
-
delete Prism.languages.c.boolean;
|
|
2139
|
-
var le = {}, ce;
|
|
2140
|
-
function Le() {
|
|
2141
|
-
return ce || (ce = 1, (function(e) {
|
|
2142
|
-
var o = /\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/, t = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function() {
|
|
2143
|
-
return o.source;
|
|
2144
|
-
});
|
|
2145
|
-
e.languages.cpp = e.languages.extend("c", {
|
|
2146
|
-
"class-name": [
|
|
2147
|
-
{
|
|
2148
|
-
pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g, function() {
|
|
2149
|
-
return o.source;
|
|
2150
|
-
})),
|
|
2151
|
-
lookbehind: !0
|
|
2152
|
-
},
|
|
2153
|
-
// This is intended to capture the class name of method implementations like:
|
|
2154
|
-
// void foo::bar() const {}
|
|
2155
|
-
// However! The `foo` in the above example could also be a namespace, so we only capture the class name if
|
|
2156
|
-
// it starts with an uppercase letter. This approximation should give decent results.
|
|
2157
|
-
/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,
|
|
2158
|
-
// This will capture the class name before destructors like:
|
|
2159
|
-
// Foo::~Foo() {}
|
|
2160
|
-
/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,
|
|
2161
|
-
// This also intends to capture the class name of method implementations but here the class has template
|
|
2162
|
-
// parameters, so it can't be a namespace (until C++ adds generic namespaces).
|
|
2163
|
-
/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/
|
|
2164
|
-
],
|
|
2165
|
-
keyword: o,
|
|
2166
|
-
number: {
|
|
2167
|
-
pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,
|
|
2168
|
-
greedy: !0
|
|
2169
|
-
},
|
|
2170
|
-
operator: />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
|
|
2171
|
-
boolean: /\b(?:false|true)\b/
|
|
2172
|
-
}), e.languages.insertBefore("cpp", "string", {
|
|
2173
|
-
module: {
|
|
2174
|
-
// https://en.cppreference.com/w/cpp/language/modules
|
|
2175
|
-
pattern: RegExp(
|
|
2176
|
-
/(\b(?:import|module)\s+)/.source + "(?:" + // header-name
|
|
2177
|
-
/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + "|" + // module name or partition or both
|
|
2178
|
-
/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, function() {
|
|
2179
|
-
return t;
|
|
2180
|
-
}) + ")"
|
|
2181
|
-
),
|
|
2182
|
-
lookbehind: !0,
|
|
2183
|
-
greedy: !0,
|
|
2184
|
-
inside: {
|
|
2185
|
-
string: /^[<"][\s\S]+/,
|
|
2186
|
-
operator: /:/,
|
|
2187
|
-
punctuation: /\./
|
|
2188
|
-
}
|
|
2189
|
-
},
|
|
2190
|
-
"raw-string": {
|
|
2191
|
-
pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,
|
|
2192
|
-
alias: "string",
|
|
2193
|
-
greedy: !0
|
|
2194
|
-
}
|
|
2195
|
-
}), e.languages.insertBefore("cpp", "keyword", {
|
|
2196
|
-
"generic-function": {
|
|
2197
|
-
pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,
|
|
2198
|
-
inside: {
|
|
2199
|
-
function: /^\w+/,
|
|
2200
|
-
generic: {
|
|
2201
|
-
pattern: /<[\s\S]+/,
|
|
2202
|
-
alias: "class-name",
|
|
2203
|
-
inside: e.languages.cpp
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
}
|
|
2207
|
-
}), e.languages.insertBefore("cpp", "operator", {
|
|
2208
|
-
"double-colon": {
|
|
2209
|
-
pattern: /::/,
|
|
2210
|
-
alias: "punctuation"
|
|
2211
|
-
}
|
|
2212
|
-
}), e.languages.insertBefore("cpp", "class-name", {
|
|
2213
|
-
// the base clause is an optional list of parent classes
|
|
2214
|
-
// https://en.cppreference.com/w/cpp/language/class
|
|
2215
|
-
"base-clause": {
|
|
2216
|
-
pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,
|
|
2217
|
-
lookbehind: !0,
|
|
2218
|
-
greedy: !0,
|
|
2219
|
-
inside: e.languages.extend("cpp", {})
|
|
2220
|
-
}
|
|
2221
|
-
}), e.languages.insertBefore("inside", "double-colon", {
|
|
2222
|
-
// All untokenized words that are not namespaces should be class names
|
|
2223
|
-
"class-name": /\b[a-z_]\w*\b(?!\s*::)/i
|
|
2224
|
-
}, e.languages.cpp["base-clause"]);
|
|
2225
|
-
})(Prism)), le;
|
|
2226
|
-
}
|
|
2227
|
-
Le();
|
|
2228
|
-
Prism.languages.go = Prism.languages.extend("clike", {
|
|
2229
|
-
string: {
|
|
2230
|
-
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
|
|
2231
|
-
lookbehind: !0,
|
|
2232
|
-
greedy: !0
|
|
2233
|
-
},
|
|
2234
|
-
keyword: /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
|
|
2235
|
-
boolean: /\b(?:_|false|iota|nil|true)\b/,
|
|
2236
|
-
number: [
|
|
2237
|
-
// binary and octal integers
|
|
2238
|
-
/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
|
|
2239
|
-
// hexadecimal integers and floats
|
|
2240
|
-
/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
|
|
2241
|
-
// decimal integers and floats
|
|
2242
|
-
/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
|
|
2243
|
-
],
|
|
2244
|
-
operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
|
|
2245
|
-
builtin: /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
|
|
2246
|
-
});
|
|
2247
|
-
Prism.languages.insertBefore("go", "string", {
|
|
2248
|
-
char: {
|
|
2249
|
-
pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
|
|
2250
|
-
greedy: !0
|
|
2251
|
-
}
|
|
2252
|
-
});
|
|
2253
|
-
delete Prism.languages.go["class-name"];
|
|
2254
|
-
var de = {}, pe;
|
|
2255
|
-
function Ce() {
|
|
2256
|
-
return pe || (pe = 1, (function(e) {
|
|
2257
|
-
for (var o = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, t = 0; t < 2; t++)
|
|
2258
|
-
o = o.replace(/<self>/g, function() {
|
|
2259
|
-
return o;
|
|
2260
|
-
});
|
|
2261
|
-
o = o.replace(/<self>/g, function() {
|
|
2262
|
-
return /[^\s\S]/.source;
|
|
2263
|
-
}), e.languages.rust = {
|
|
2264
|
-
comment: [
|
|
2265
|
-
{
|
|
2266
|
-
pattern: RegExp(/(^|[^\\])/.source + o),
|
|
2267
|
-
lookbehind: !0,
|
|
2268
|
-
greedy: !0
|
|
2269
|
-
},
|
|
2270
|
-
{
|
|
2271
|
-
pattern: /(^|[^\\:])\/\/.*/,
|
|
2272
|
-
lookbehind: !0,
|
|
2273
|
-
greedy: !0
|
|
2274
|
-
}
|
|
2275
|
-
],
|
|
2276
|
-
string: {
|
|
2277
|
-
pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,
|
|
2278
|
-
greedy: !0
|
|
2279
|
-
},
|
|
2280
|
-
char: {
|
|
2281
|
-
pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,
|
|
2282
|
-
greedy: !0
|
|
2283
|
-
},
|
|
2284
|
-
attribute: {
|
|
2285
|
-
pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,
|
|
2286
|
-
greedy: !0,
|
|
2287
|
-
alias: "attr-name",
|
|
2288
|
-
inside: {
|
|
2289
|
-
string: null
|
|
2290
|
-
// see below
|
|
2291
|
-
}
|
|
2292
|
-
},
|
|
2293
|
-
// Closure params should not be confused with bitwise OR |
|
|
2294
|
-
"closure-params": {
|
|
2295
|
-
pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,
|
|
2296
|
-
lookbehind: !0,
|
|
2297
|
-
greedy: !0,
|
|
2298
|
-
inside: {
|
|
2299
|
-
"closure-punctuation": {
|
|
2300
|
-
pattern: /^\||\|$/,
|
|
2301
|
-
alias: "punctuation"
|
|
2302
|
-
},
|
|
2303
|
-
rest: null
|
|
2304
|
-
// see below
|
|
2305
|
-
}
|
|
2306
|
-
},
|
|
2307
|
-
"lifetime-annotation": {
|
|
2308
|
-
pattern: /'\w+/,
|
|
2309
|
-
alias: "symbol"
|
|
2310
|
-
},
|
|
2311
|
-
"fragment-specifier": {
|
|
2312
|
-
pattern: /(\$\w+:)[a-z]+/,
|
|
2313
|
-
lookbehind: !0,
|
|
2314
|
-
alias: "punctuation"
|
|
2315
|
-
},
|
|
2316
|
-
variable: /\$\w+/,
|
|
2317
|
-
"function-definition": {
|
|
2318
|
-
pattern: /(\bfn\s+)\w+/,
|
|
2319
|
-
lookbehind: !0,
|
|
2320
|
-
alias: "function"
|
|
2321
|
-
},
|
|
2322
|
-
"type-definition": {
|
|
2323
|
-
pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/,
|
|
2324
|
-
lookbehind: !0,
|
|
2325
|
-
alias: "class-name"
|
|
2326
|
-
},
|
|
2327
|
-
"module-declaration": [
|
|
2328
|
-
{
|
|
2329
|
-
pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,
|
|
2330
|
-
lookbehind: !0,
|
|
2331
|
-
alias: "namespace"
|
|
2332
|
-
},
|
|
2333
|
-
{
|
|
2334
|
-
pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,
|
|
2335
|
-
lookbehind: !0,
|
|
2336
|
-
alias: "namespace",
|
|
2337
|
-
inside: {
|
|
2338
|
-
punctuation: /::/
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
],
|
|
2342
|
-
keyword: [
|
|
2343
|
-
// https://github.com/rust-lang/reference/blob/master/src/keywords.md
|
|
2344
|
-
/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,
|
|
2345
|
-
// primitives and str
|
|
2346
|
-
// https://doc.rust-lang.org/stable/rust-by-example/primitives.html
|
|
2347
|
-
/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/
|
|
2348
|
-
],
|
|
2349
|
-
// functions can technically start with an upper-case letter, but this will introduce a lot of false positives
|
|
2350
|
-
// and Rust's naming conventions recommend snake_case anyway.
|
|
2351
|
-
// https://doc.rust-lang.org/1.0.0/style/style/naming/README.html
|
|
2352
|
-
function: /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,
|
|
2353
|
-
macro: {
|
|
2354
|
-
pattern: /\b\w+!/,
|
|
2355
|
-
alias: "property"
|
|
2356
|
-
},
|
|
2357
|
-
constant: /\b[A-Z_][A-Z_\d]+\b/,
|
|
2358
|
-
"class-name": /\b[A-Z]\w*\b/,
|
|
2359
|
-
namespace: {
|
|
2360
|
-
pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,
|
|
2361
|
-
inside: {
|
|
2362
|
-
punctuation: /::/
|
|
2363
|
-
}
|
|
2364
|
-
},
|
|
2365
|
-
// Hex, oct, bin, dec numbers with visual separators and type suffix
|
|
2366
|
-
number: /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,
|
|
2367
|
-
boolean: /\b(?:false|true)\b/,
|
|
2368
|
-
punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
|
|
2369
|
-
operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
|
|
2370
|
-
}, e.languages.rust["closure-params"].inside.rest = e.languages.rust, e.languages.rust.attribute.inside.string = e.languages.rust.string;
|
|
2371
|
-
})(Prism)), de;
|
|
2372
|
-
}
|
|
2373
|
-
Ce();
|
|
2374
|
-
(function(e) {
|
|
2375
|
-
function o(t, s) {
|
|
2376
|
-
return "___" + t.toUpperCase() + s + "___";
|
|
2377
|
-
}
|
|
2378
|
-
Object.defineProperties(e.languages["markup-templating"] = {}, {
|
|
2379
|
-
buildPlaceholders: {
|
|
2380
|
-
/**
|
|
2381
|
-
* Tokenize all inline templating expressions matching `placeholderPattern`.
|
|
2382
|
-
*
|
|
2383
|
-
* If `replaceFilter` is provided, only matches of `placeholderPattern` for which `replaceFilter` returns
|
|
2384
|
-
* `true` will be replaced.
|
|
2385
|
-
*
|
|
2386
|
-
* @param {object} env The environment of the `before-tokenize` hook.
|
|
2387
|
-
* @param {string} language The language id.
|
|
2388
|
-
* @param {RegExp} placeholderPattern The matches of this pattern will be replaced by placeholders.
|
|
2389
|
-
* @param {(match: string) => boolean} [replaceFilter]
|
|
2390
|
-
*/
|
|
2391
|
-
value: function(t, s, b, E) {
|
|
2392
|
-
if (t.language === s) {
|
|
2393
|
-
var h = t.tokenStack = [];
|
|
2394
|
-
t.code = t.code.replace(b, function(r) {
|
|
2395
|
-
if (typeof E == "function" && !E(r))
|
|
2396
|
-
return r;
|
|
2397
|
-
for (var c = h.length, d; t.code.indexOf(d = o(s, c)) !== -1; )
|
|
2398
|
-
++c;
|
|
2399
|
-
return h[c] = r, d;
|
|
2400
|
-
}), t.grammar = e.languages.markup;
|
|
2401
|
-
}
|
|
2402
|
-
}
|
|
2403
|
-
},
|
|
2404
|
-
tokenizePlaceholders: {
|
|
2405
|
-
/**
|
|
2406
|
-
* Replace placeholders with proper tokens after tokenizing.
|
|
2407
|
-
*
|
|
2408
|
-
* @param {object} env The environment of the `after-tokenize` hook.
|
|
2409
|
-
* @param {string} language The language id.
|
|
2410
|
-
*/
|
|
2411
|
-
value: function(t, s) {
|
|
2412
|
-
if (t.language !== s || !t.tokenStack)
|
|
2413
|
-
return;
|
|
2414
|
-
t.grammar = e.languages[s];
|
|
2415
|
-
var b = 0, E = Object.keys(t.tokenStack);
|
|
2416
|
-
function h(r) {
|
|
2417
|
-
for (var c = 0; c < r.length && !(b >= E.length); c++) {
|
|
2418
|
-
var d = r[c];
|
|
2419
|
-
if (typeof d == "string" || d.content && typeof d.content == "string") {
|
|
2420
|
-
var m = E[b], p = t.tokenStack[m], _ = typeof d == "string" ? d : d.content, w = o(s, m), x = _.indexOf(w);
|
|
2421
|
-
if (x > -1) {
|
|
2422
|
-
++b;
|
|
2423
|
-
var v = _.substring(0, x), y = new e.Token(s, e.tokenize(p, t.grammar), "language-" + s, p), S = _.substring(x + w.length), a = [];
|
|
2424
|
-
v && a.push.apply(a, h([v])), a.push(y), S && a.push.apply(a, h([S])), typeof d == "string" ? r.splice.apply(r, [c, 1].concat(a)) : d.content = a;
|
|
2425
|
-
}
|
|
2426
|
-
} else d.content && h(d.content);
|
|
2427
|
-
}
|
|
2428
|
-
return r;
|
|
2429
|
-
}
|
|
2430
|
-
h(t.tokens);
|
|
2431
|
-
}
|
|
2432
|
-
}
|
|
2433
|
-
});
|
|
2434
|
-
})(Prism);
|
|
2435
|
-
var ge = {}, fe;
|
|
2436
|
-
function $e() {
|
|
2437
|
-
return fe || (fe = 1, (function(e) {
|
|
2438
|
-
var o = /\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/, t = [
|
|
2439
|
-
{
|
|
2440
|
-
pattern: /\b(?:false|true)\b/i,
|
|
2441
|
-
alias: "boolean"
|
|
2442
|
-
},
|
|
2443
|
-
{
|
|
2444
|
-
pattern: /(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,
|
|
2445
|
-
greedy: !0,
|
|
2446
|
-
lookbehind: !0
|
|
2447
|
-
},
|
|
2448
|
-
{
|
|
2449
|
-
pattern: /(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,
|
|
2450
|
-
greedy: !0,
|
|
2451
|
-
lookbehind: !0
|
|
2452
|
-
},
|
|
2453
|
-
/\b(?:null)\b/i,
|
|
2454
|
-
/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/
|
|
2455
|
-
], s = /\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, b = /<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/, E = /[{}\[\](),:;]/;
|
|
2456
|
-
e.languages.php = {
|
|
2457
|
-
delimiter: {
|
|
2458
|
-
pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i,
|
|
2459
|
-
alias: "important"
|
|
2460
|
-
},
|
|
2461
|
-
comment: o,
|
|
2462
|
-
variable: /\$+(?:\w+\b|(?=\{))/,
|
|
2463
|
-
package: {
|
|
2464
|
-
pattern: /(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
|
|
2465
|
-
lookbehind: !0,
|
|
2466
|
-
inside: {
|
|
2467
|
-
punctuation: /\\/
|
|
2468
|
-
}
|
|
2469
|
-
},
|
|
2470
|
-
"class-name-definition": {
|
|
2471
|
-
pattern: /(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,
|
|
2472
|
-
lookbehind: !0,
|
|
2473
|
-
alias: "class-name"
|
|
2474
|
-
},
|
|
2475
|
-
"function-definition": {
|
|
2476
|
-
pattern: /(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,
|
|
2477
|
-
lookbehind: !0,
|
|
2478
|
-
alias: "function"
|
|
2479
|
-
},
|
|
2480
|
-
keyword: [
|
|
2481
|
-
{
|
|
2482
|
-
pattern: /(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,
|
|
2483
|
-
alias: "type-casting",
|
|
2484
|
-
greedy: !0,
|
|
2485
|
-
lookbehind: !0
|
|
2486
|
-
},
|
|
2487
|
-
{
|
|
2488
|
-
pattern: /([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,
|
|
2489
|
-
alias: "type-hint",
|
|
2490
|
-
greedy: !0,
|
|
2491
|
-
lookbehind: !0
|
|
2492
|
-
},
|
|
2493
|
-
{
|
|
2494
|
-
pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,
|
|
2495
|
-
alias: "return-type",
|
|
2496
|
-
greedy: !0,
|
|
2497
|
-
lookbehind: !0
|
|
2498
|
-
},
|
|
2499
|
-
{
|
|
2500
|
-
pattern: /\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,
|
|
2501
|
-
alias: "type-declaration",
|
|
2502
|
-
greedy: !0
|
|
2503
|
-
},
|
|
2504
|
-
{
|
|
2505
|
-
pattern: /(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,
|
|
2506
|
-
alias: "type-declaration",
|
|
2507
|
-
greedy: !0,
|
|
2508
|
-
lookbehind: !0
|
|
2509
|
-
},
|
|
2510
|
-
{
|
|
2511
|
-
pattern: /\b(?:parent|self|static)(?=\s*::)/i,
|
|
2512
|
-
alias: "static-context",
|
|
2513
|
-
greedy: !0
|
|
2514
|
-
},
|
|
2515
|
-
{
|
|
2516
|
-
// yield from
|
|
2517
|
-
pattern: /(\byield\s+)from\b/i,
|
|
2518
|
-
lookbehind: !0
|
|
2519
|
-
},
|
|
2520
|
-
// `class` is always a keyword unlike other keywords
|
|
2521
|
-
/\bclass\b/i,
|
|
2522
|
-
{
|
|
2523
|
-
// https://www.php.net/manual/en/reserved.keywords.php
|
|
2524
|
-
//
|
|
2525
|
-
// keywords cannot be preceded by "->"
|
|
2526
|
-
// the complex lookbehind means `(?<!(?:->|::)\s*)`
|
|
2527
|
-
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,
|
|
2528
|
-
lookbehind: !0
|
|
2529
|
-
}
|
|
2530
|
-
],
|
|
2531
|
-
"argument-name": {
|
|
2532
|
-
pattern: /([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,
|
|
2533
|
-
lookbehind: !0
|
|
2534
|
-
},
|
|
2535
|
-
"class-name": [
|
|
2536
|
-
{
|
|
2537
|
-
pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,
|
|
2538
|
-
greedy: !0,
|
|
2539
|
-
lookbehind: !0
|
|
2540
|
-
},
|
|
2541
|
-
{
|
|
2542
|
-
pattern: /(\|\s*)\b[a-z_]\w*(?!\\)\b/i,
|
|
2543
|
-
greedy: !0,
|
|
2544
|
-
lookbehind: !0
|
|
2545
|
-
},
|
|
2546
|
-
{
|
|
2547
|
-
pattern: /\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,
|
|
2548
|
-
greedy: !0
|
|
2549
|
-
},
|
|
2550
|
-
{
|
|
2551
|
-
pattern: /(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,
|
|
2552
|
-
alias: "class-name-fully-qualified",
|
|
2553
|
-
greedy: !0,
|
|
2554
|
-
lookbehind: !0,
|
|
2555
|
-
inside: {
|
|
2556
|
-
punctuation: /\\/
|
|
2557
|
-
}
|
|
2558
|
-
},
|
|
2559
|
-
{
|
|
2560
|
-
pattern: /(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,
|
|
2561
|
-
alias: "class-name-fully-qualified",
|
|
2562
|
-
greedy: !0,
|
|
2563
|
-
inside: {
|
|
2564
|
-
punctuation: /\\/
|
|
2565
|
-
}
|
|
2566
|
-
},
|
|
2567
|
-
{
|
|
2568
|
-
pattern: /(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
|
|
2569
|
-
alias: "class-name-fully-qualified",
|
|
2570
|
-
greedy: !0,
|
|
2571
|
-
lookbehind: !0,
|
|
2572
|
-
inside: {
|
|
2573
|
-
punctuation: /\\/
|
|
2574
|
-
}
|
|
2575
|
-
},
|
|
2576
|
-
{
|
|
2577
|
-
pattern: /\b[a-z_]\w*(?=\s*\$)/i,
|
|
2578
|
-
alias: "type-declaration",
|
|
2579
|
-
greedy: !0
|
|
2580
|
-
},
|
|
2581
|
-
{
|
|
2582
|
-
pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
|
|
2583
|
-
alias: ["class-name-fully-qualified", "type-declaration"],
|
|
2584
|
-
greedy: !0,
|
|
2585
|
-
inside: {
|
|
2586
|
-
punctuation: /\\/
|
|
2587
|
-
}
|
|
2588
|
-
},
|
|
2589
|
-
{
|
|
2590
|
-
pattern: /\b[a-z_]\w*(?=\s*::)/i,
|
|
2591
|
-
alias: "static-context",
|
|
2592
|
-
greedy: !0
|
|
2593
|
-
},
|
|
2594
|
-
{
|
|
2595
|
-
pattern: /(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,
|
|
2596
|
-
alias: ["class-name-fully-qualified", "static-context"],
|
|
2597
|
-
greedy: !0,
|
|
2598
|
-
inside: {
|
|
2599
|
-
punctuation: /\\/
|
|
2600
|
-
}
|
|
2601
|
-
},
|
|
2602
|
-
{
|
|
2603
|
-
pattern: /([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,
|
|
2604
|
-
alias: "type-hint",
|
|
2605
|
-
greedy: !0,
|
|
2606
|
-
lookbehind: !0
|
|
2607
|
-
},
|
|
2608
|
-
{
|
|
2609
|
-
pattern: /([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,
|
|
2610
|
-
alias: ["class-name-fully-qualified", "type-hint"],
|
|
2611
|
-
greedy: !0,
|
|
2612
|
-
lookbehind: !0,
|
|
2613
|
-
inside: {
|
|
2614
|
-
punctuation: /\\/
|
|
2615
|
-
}
|
|
2616
|
-
},
|
|
2617
|
-
{
|
|
2618
|
-
pattern: /(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,
|
|
2619
|
-
alias: "return-type",
|
|
2620
|
-
greedy: !0,
|
|
2621
|
-
lookbehind: !0
|
|
2622
|
-
},
|
|
2623
|
-
{
|
|
2624
|
-
pattern: /(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
|
|
2625
|
-
alias: ["class-name-fully-qualified", "return-type"],
|
|
2626
|
-
greedy: !0,
|
|
2627
|
-
lookbehind: !0,
|
|
2628
|
-
inside: {
|
|
2629
|
-
punctuation: /\\/
|
|
2630
|
-
}
|
|
2631
|
-
}
|
|
2632
|
-
],
|
|
2633
|
-
constant: t,
|
|
2634
|
-
function: {
|
|
2635
|
-
pattern: /(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,
|
|
2636
|
-
lookbehind: !0,
|
|
2637
|
-
inside: {
|
|
2638
|
-
punctuation: /\\/
|
|
2639
|
-
}
|
|
2640
|
-
},
|
|
2641
|
-
property: {
|
|
2642
|
-
pattern: /(->\s*)\w+/,
|
|
2643
|
-
lookbehind: !0
|
|
2644
|
-
},
|
|
2645
|
-
number: s,
|
|
2646
|
-
operator: b,
|
|
2647
|
-
punctuation: E
|
|
2648
|
-
};
|
|
2649
|
-
var h = {
|
|
2650
|
-
pattern: /\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,
|
|
2651
|
-
lookbehind: !0,
|
|
2652
|
-
inside: e.languages.php
|
|
2653
|
-
}, r = [
|
|
2654
|
-
{
|
|
2655
|
-
pattern: /<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,
|
|
2656
|
-
alias: "nowdoc-string",
|
|
2657
|
-
greedy: !0,
|
|
2658
|
-
inside: {
|
|
2659
|
-
delimiter: {
|
|
2660
|
-
pattern: /^<<<'[^']+'|[a-z_]\w*;$/i,
|
|
2661
|
-
alias: "symbol",
|
|
2662
|
-
inside: {
|
|
2663
|
-
punctuation: /^<<<'?|[';]$/
|
|
2664
|
-
}
|
|
2665
|
-
}
|
|
2666
|
-
}
|
|
2667
|
-
},
|
|
2668
|
-
{
|
|
2669
|
-
pattern: /<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,
|
|
2670
|
-
alias: "heredoc-string",
|
|
2671
|
-
greedy: !0,
|
|
2672
|
-
inside: {
|
|
2673
|
-
delimiter: {
|
|
2674
|
-
pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,
|
|
2675
|
-
alias: "symbol",
|
|
2676
|
-
inside: {
|
|
2677
|
-
punctuation: /^<<<"?|[";]$/
|
|
2678
|
-
}
|
|
2679
|
-
},
|
|
2680
|
-
interpolation: h
|
|
2681
|
-
}
|
|
2682
|
-
},
|
|
2683
|
-
{
|
|
2684
|
-
pattern: /`(?:\\[\s\S]|[^\\`])*`/,
|
|
2685
|
-
alias: "backtick-quoted-string",
|
|
2686
|
-
greedy: !0
|
|
2687
|
-
},
|
|
2688
|
-
{
|
|
2689
|
-
pattern: /'(?:\\[\s\S]|[^\\'])*'/,
|
|
2690
|
-
alias: "single-quoted-string",
|
|
2691
|
-
greedy: !0
|
|
2692
|
-
},
|
|
2693
|
-
{
|
|
2694
|
-
pattern: /"(?:\\[\s\S]|[^\\"])*"/,
|
|
2695
|
-
alias: "double-quoted-string",
|
|
2696
|
-
greedy: !0,
|
|
2697
|
-
inside: {
|
|
2698
|
-
interpolation: h
|
|
2699
|
-
}
|
|
2700
|
-
}
|
|
2701
|
-
];
|
|
2702
|
-
e.languages.insertBefore("php", "variable", {
|
|
2703
|
-
string: r,
|
|
2704
|
-
attribute: {
|
|
2705
|
-
pattern: /#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,
|
|
2706
|
-
greedy: !0,
|
|
2707
|
-
inside: {
|
|
2708
|
-
"attribute-content": {
|
|
2709
|
-
pattern: /^(#\[)[\s\S]+(?=\]$)/,
|
|
2710
|
-
lookbehind: !0,
|
|
2711
|
-
// inside can appear subset of php
|
|
2712
|
-
inside: {
|
|
2713
|
-
comment: o,
|
|
2714
|
-
string: r,
|
|
2715
|
-
"attribute-class-name": [
|
|
2716
|
-
{
|
|
2717
|
-
pattern: /([^:]|^)\b[a-z_]\w*(?!\\)\b/i,
|
|
2718
|
-
alias: "class-name",
|
|
2719
|
-
greedy: !0,
|
|
2720
|
-
lookbehind: !0
|
|
2721
|
-
},
|
|
2722
|
-
{
|
|
2723
|
-
pattern: /([^:]|^)(?:\\?\b[a-z_]\w*)+/i,
|
|
2724
|
-
alias: [
|
|
2725
|
-
"class-name",
|
|
2726
|
-
"class-name-fully-qualified"
|
|
2727
|
-
],
|
|
2728
|
-
greedy: !0,
|
|
2729
|
-
lookbehind: !0,
|
|
2730
|
-
inside: {
|
|
2731
|
-
punctuation: /\\/
|
|
2732
|
-
}
|
|
2733
|
-
}
|
|
2734
|
-
],
|
|
2735
|
-
constant: t,
|
|
2736
|
-
number: s,
|
|
2737
|
-
operator: b,
|
|
2738
|
-
punctuation: E
|
|
2739
|
-
}
|
|
2740
|
-
},
|
|
2741
|
-
delimiter: {
|
|
2742
|
-
pattern: /^#\[|\]$/,
|
|
2743
|
-
alias: "punctuation"
|
|
2744
|
-
}
|
|
2745
|
-
}
|
|
2746
|
-
}
|
|
2747
|
-
}), e.hooks.add("before-tokenize", function(c) {
|
|
2748
|
-
if (/<\?/.test(c.code)) {
|
|
2749
|
-
var d = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;
|
|
2750
|
-
e.languages["markup-templating"].buildPlaceholders(c, "php", d);
|
|
2751
|
-
}
|
|
2752
|
-
}), e.hooks.add("after-tokenize", function(c) {
|
|
2753
|
-
e.languages["markup-templating"].tokenizePlaceholders(c, "php");
|
|
2754
|
-
});
|
|
2755
|
-
})(Prism)), ge;
|
|
2756
|
-
}
|
|
2757
|
-
$e();
|
|
2758
|
-
var be = {}, he;
|
|
2759
|
-
function De() {
|
|
2760
|
-
return he || (he = 1, (function(e) {
|
|
2761
|
-
e.languages.ruby = e.languages.extend("clike", {
|
|
2762
|
-
comment: {
|
|
2763
|
-
pattern: /#.*|^=begin\s[\s\S]*?^=end/m,
|
|
2764
|
-
greedy: !0
|
|
2765
|
-
},
|
|
2766
|
-
"class-name": {
|
|
2767
|
-
pattern: /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
|
|
2768
|
-
lookbehind: !0,
|
|
2769
|
-
inside: {
|
|
2770
|
-
punctuation: /[.\\]/
|
|
2771
|
-
}
|
|
2772
|
-
},
|
|
2773
|
-
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/,
|
|
2774
|
-
operator: /\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
|
|
2775
|
-
punctuation: /[(){}[\].,;]/
|
|
2776
|
-
}), e.languages.insertBefore("ruby", "operator", {
|
|
2777
|
-
"double-colon": {
|
|
2778
|
-
pattern: /::/,
|
|
2779
|
-
alias: "punctuation"
|
|
2780
|
-
}
|
|
2781
|
-
});
|
|
2782
|
-
var o = {
|
|
2783
|
-
pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
|
|
2784
|
-
lookbehind: !0,
|
|
2785
|
-
inside: {
|
|
2786
|
-
content: {
|
|
2787
|
-
pattern: /^(#\{)[\s\S]+(?=\}$)/,
|
|
2788
|
-
lookbehind: !0,
|
|
2789
|
-
inside: e.languages.ruby
|
|
2790
|
-
},
|
|
2791
|
-
delimiter: {
|
|
2792
|
-
pattern: /^#\{|\}$/,
|
|
2793
|
-
alias: "punctuation"
|
|
2794
|
-
}
|
|
2795
|
-
}
|
|
2796
|
-
};
|
|
2797
|
-
delete e.languages.ruby.function;
|
|
2798
|
-
var t = "(?:" + [
|
|
2799
|
-
/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
|
|
2800
|
-
/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,
|
|
2801
|
-
/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,
|
|
2802
|
-
/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,
|
|
2803
|
-
/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source
|
|
2804
|
-
].join("|") + ")", s = /(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;
|
|
2805
|
-
e.languages.insertBefore("ruby", "keyword", {
|
|
2806
|
-
"regex-literal": [
|
|
2807
|
-
{
|
|
2808
|
-
pattern: RegExp(/%r/.source + t + /[egimnosux]{0,6}/.source),
|
|
2809
|
-
greedy: !0,
|
|
2810
|
-
inside: {
|
|
2811
|
-
interpolation: o,
|
|
2812
|
-
regex: /[\s\S]+/
|
|
2813
|
-
}
|
|
2814
|
-
},
|
|
2815
|
-
{
|
|
2816
|
-
pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
|
|
2817
|
-
lookbehind: !0,
|
|
2818
|
-
greedy: !0,
|
|
2819
|
-
inside: {
|
|
2820
|
-
interpolation: o,
|
|
2821
|
-
regex: /[\s\S]+/
|
|
2822
|
-
}
|
|
2823
|
-
}
|
|
2824
|
-
],
|
|
2825
|
-
variable: /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
|
|
2826
|
-
symbol: [
|
|
2827
|
-
{
|
|
2828
|
-
pattern: RegExp(/(^|[^:]):/.source + s),
|
|
2829
|
-
lookbehind: !0,
|
|
2830
|
-
greedy: !0
|
|
2831
|
-
},
|
|
2832
|
-
{
|
|
2833
|
-
pattern: RegExp(/([\r\n{(,][ \t]*)/.source + s + /(?=:(?!:))/.source),
|
|
2834
|
-
lookbehind: !0,
|
|
2835
|
-
greedy: !0
|
|
2836
|
-
}
|
|
2837
|
-
],
|
|
2838
|
-
"method-definition": {
|
|
2839
|
-
pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
|
|
2840
|
-
lookbehind: !0,
|
|
2841
|
-
inside: {
|
|
2842
|
-
function: /\b\w+$/,
|
|
2843
|
-
keyword: /^self\b/,
|
|
2844
|
-
"class-name": /^\w+/,
|
|
2845
|
-
punctuation: /\./
|
|
2846
|
-
}
|
|
2847
|
-
}
|
|
2848
|
-
}), e.languages.insertBefore("ruby", "string", {
|
|
2849
|
-
"string-literal": [
|
|
2850
|
-
{
|
|
2851
|
-
pattern: RegExp(/%[qQiIwWs]?/.source + t),
|
|
2852
|
-
greedy: !0,
|
|
2853
|
-
inside: {
|
|
2854
|
-
interpolation: o,
|
|
2855
|
-
string: /[\s\S]+/
|
|
2856
|
-
}
|
|
2857
|
-
},
|
|
2858
|
-
{
|
|
2859
|
-
pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
|
|
2860
|
-
greedy: !0,
|
|
2861
|
-
inside: {
|
|
2862
|
-
interpolation: o,
|
|
2863
|
-
string: /[\s\S]+/
|
|
2864
|
-
}
|
|
2865
|
-
},
|
|
2866
|
-
{
|
|
2867
|
-
pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
|
|
2868
|
-
alias: "heredoc-string",
|
|
2869
|
-
greedy: !0,
|
|
2870
|
-
inside: {
|
|
2871
|
-
delimiter: {
|
|
2872
|
-
pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
|
|
2873
|
-
inside: {
|
|
2874
|
-
symbol: /\b\w+/,
|
|
2875
|
-
punctuation: /^<<[-~]?/
|
|
2876
|
-
}
|
|
2877
|
-
},
|
|
2878
|
-
interpolation: o,
|
|
2879
|
-
string: /[\s\S]+/
|
|
2880
|
-
}
|
|
2881
|
-
},
|
|
2882
|
-
{
|
|
2883
|
-
pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
|
|
2884
|
-
alias: "heredoc-string",
|
|
2885
|
-
greedy: !0,
|
|
2886
|
-
inside: {
|
|
2887
|
-
delimiter: {
|
|
2888
|
-
pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
|
|
2889
|
-
inside: {
|
|
2890
|
-
symbol: /\b\w+/,
|
|
2891
|
-
punctuation: /^<<[-~]?'|'$/
|
|
2892
|
-
}
|
|
2893
|
-
},
|
|
2894
|
-
string: /[\s\S]+/
|
|
2895
|
-
}
|
|
2896
|
-
}
|
|
2897
|
-
],
|
|
2898
|
-
"command-literal": [
|
|
2899
|
-
{
|
|
2900
|
-
pattern: RegExp(/%x/.source + t),
|
|
2901
|
-
greedy: !0,
|
|
2902
|
-
inside: {
|
|
2903
|
-
interpolation: o,
|
|
2904
|
-
command: {
|
|
2905
|
-
pattern: /[\s\S]+/,
|
|
2906
|
-
alias: "string"
|
|
2907
|
-
}
|
|
2908
|
-
}
|
|
2909
|
-
},
|
|
2910
|
-
{
|
|
2911
|
-
pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
|
|
2912
|
-
greedy: !0,
|
|
2913
|
-
inside: {
|
|
2914
|
-
interpolation: o,
|
|
2915
|
-
command: {
|
|
2916
|
-
pattern: /[\s\S]+/,
|
|
2917
|
-
alias: "string"
|
|
2918
|
-
}
|
|
2919
|
-
}
|
|
2920
|
-
}
|
|
2921
|
-
]
|
|
2922
|
-
}), delete e.languages.ruby.string, e.languages.insertBefore("ruby", "number", {
|
|
2923
|
-
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/,
|
|
2924
|
-
constant: /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/
|
|
2925
|
-
}), e.languages.rb = e.languages.ruby;
|
|
2926
|
-
})(Prism)), be;
|
|
2927
|
-
}
|
|
2928
|
-
De();
|
|
2929
|
-
Prism.languages.sql = {
|
|
2930
|
-
comment: {
|
|
2931
|
-
pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
|
|
2932
|
-
lookbehind: !0
|
|
2933
|
-
},
|
|
2934
|
-
variable: [
|
|
2935
|
-
{
|
|
2936
|
-
pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,
|
|
2937
|
-
greedy: !0
|
|
2938
|
-
},
|
|
2939
|
-
/@[\w.$]+/
|
|
2940
|
-
],
|
|
2941
|
-
string: {
|
|
2942
|
-
pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,
|
|
2943
|
-
greedy: !0,
|
|
2944
|
-
lookbehind: !0
|
|
2945
|
-
},
|
|
2946
|
-
identifier: {
|
|
2947
|
-
pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,
|
|
2948
|
-
greedy: !0,
|
|
2949
|
-
lookbehind: !0,
|
|
2950
|
-
inside: {
|
|
2951
|
-
punctuation: /^`|`$/
|
|
2952
|
-
}
|
|
2953
|
-
},
|
|
2954
|
-
function: /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,
|
|
2955
|
-
// Should we highlight user defined functions too?
|
|
2956
|
-
keyword: /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,
|
|
2957
|
-
boolean: /\b(?:FALSE|NULL|TRUE)\b/i,
|
|
2958
|
-
number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,
|
|
2959
|
-
operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
|
|
2960
|
-
punctuation: /[;[\]()`,.]/
|
|
2961
|
-
};
|
|
2962
|
-
(function(e) {
|
|
2963
|
-
var o = /[*&][^\s[\]{},]+/, t = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/, s = "(?:" + t.source + "(?:[ ]+" + o.source + ")?|" + o.source + "(?:[ ]+" + t.source + ")?)", b = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, function() {
|
|
2964
|
-
return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
|
|
2965
|
-
}), E = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
|
|
2966
|
-
function h(r, c) {
|
|
2967
|
-
c = (c || "").replace(/m/g, "") + "m";
|
|
2968
|
-
var d = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, function() {
|
|
2969
|
-
return s;
|
|
2970
|
-
}).replace(/<<value>>/g, function() {
|
|
2971
|
-
return r;
|
|
2972
|
-
});
|
|
2973
|
-
return RegExp(d, c);
|
|
2974
|
-
}
|
|
2975
|
-
e.languages.yaml = {
|
|
2976
|
-
scalar: {
|
|
2977
|
-
pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g, function() {
|
|
2978
|
-
return s;
|
|
2979
|
-
})),
|
|
2980
|
-
lookbehind: !0,
|
|
2981
|
-
alias: "string"
|
|
2982
|
-
},
|
|
2983
|
-
comment: /#.*/,
|
|
2984
|
-
key: {
|
|
2985
|
-
pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, function() {
|
|
2986
|
-
return s;
|
|
2987
|
-
}).replace(/<<key>>/g, function() {
|
|
2988
|
-
return "(?:" + b + "|" + E + ")";
|
|
2989
|
-
})),
|
|
2990
|
-
lookbehind: !0,
|
|
2991
|
-
greedy: !0,
|
|
2992
|
-
alias: "atrule"
|
|
2993
|
-
},
|
|
2994
|
-
directive: {
|
|
2995
|
-
pattern: /(^[ \t]*)%.+/m,
|
|
2996
|
-
lookbehind: !0,
|
|
2997
|
-
alias: "important"
|
|
2998
|
-
},
|
|
2999
|
-
datetime: {
|
|
3000
|
-
pattern: h(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
|
|
3001
|
-
lookbehind: !0,
|
|
3002
|
-
alias: "number"
|
|
3003
|
-
},
|
|
3004
|
-
boolean: {
|
|
3005
|
-
pattern: h(/false|true/.source, "i"),
|
|
3006
|
-
lookbehind: !0,
|
|
3007
|
-
alias: "important"
|
|
3008
|
-
},
|
|
3009
|
-
null: {
|
|
3010
|
-
pattern: h(/null|~/.source, "i"),
|
|
3011
|
-
lookbehind: !0,
|
|
3012
|
-
alias: "important"
|
|
3013
|
-
},
|
|
3014
|
-
string: {
|
|
3015
|
-
pattern: h(E),
|
|
3016
|
-
lookbehind: !0,
|
|
3017
|
-
greedy: !0
|
|
3018
|
-
},
|
|
3019
|
-
number: {
|
|
3020
|
-
pattern: h(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"),
|
|
3021
|
-
lookbehind: !0
|
|
3022
|
-
},
|
|
3023
|
-
tag: t,
|
|
3024
|
-
important: o,
|
|
3025
|
-
punctuation: /---|[:[\]{}\-,|>?]|\.\.\./
|
|
3026
|
-
}, e.languages.yml = e.languages.yaml;
|
|
3027
|
-
})(Prism);
|
|
3028
|
-
(function(e) {
|
|
3029
|
-
var o = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;
|
|
3030
|
-
function t(m) {
|
|
3031
|
-
return m = m.replace(/<inner>/g, function() {
|
|
3032
|
-
return o;
|
|
3033
|
-
}), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + m + ")");
|
|
3034
|
-
}
|
|
3035
|
-
var s = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, b = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() {
|
|
3036
|
-
return s;
|
|
3037
|
-
}), E = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;
|
|
3038
|
-
e.languages.markdown = e.languages.extend("markup", {}), e.languages.insertBefore("markdown", "prolog", {
|
|
3039
|
-
"front-matter-block": {
|
|
3040
|
-
pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
|
|
3041
|
-
lookbehind: !0,
|
|
3042
|
-
greedy: !0,
|
|
3043
|
-
inside: {
|
|
3044
|
-
punctuation: /^---|---$/,
|
|
3045
|
-
"front-matter": {
|
|
3046
|
-
pattern: /\S+(?:\s+\S+)*/,
|
|
3047
|
-
alias: ["yaml", "language-yaml"],
|
|
3048
|
-
inside: e.languages.yaml
|
|
3049
|
-
}
|
|
3050
|
-
}
|
|
3051
|
-
},
|
|
3052
|
-
blockquote: {
|
|
3053
|
-
// > ...
|
|
3054
|
-
pattern: /^>(?:[\t ]*>)*/m,
|
|
3055
|
-
alias: "punctuation"
|
|
3056
|
-
},
|
|
3057
|
-
table: {
|
|
3058
|
-
pattern: RegExp("^" + b + E + "(?:" + b + ")*", "m"),
|
|
3059
|
-
inside: {
|
|
3060
|
-
"table-data-rows": {
|
|
3061
|
-
pattern: RegExp("^(" + b + E + ")(?:" + b + ")*$"),
|
|
3062
|
-
lookbehind: !0,
|
|
3063
|
-
inside: {
|
|
3064
|
-
"table-data": {
|
|
3065
|
-
pattern: RegExp(s),
|
|
3066
|
-
inside: e.languages.markdown
|
|
3067
|
-
},
|
|
3068
|
-
punctuation: /\|/
|
|
3069
|
-
}
|
|
3070
|
-
},
|
|
3071
|
-
"table-line": {
|
|
3072
|
-
pattern: RegExp("^(" + b + ")" + E + "$"),
|
|
3073
|
-
lookbehind: !0,
|
|
3074
|
-
inside: {
|
|
3075
|
-
punctuation: /\||:?-{3,}:?/
|
|
3076
|
-
}
|
|
3077
|
-
},
|
|
3078
|
-
"table-header-row": {
|
|
3079
|
-
pattern: RegExp("^" + b + "$"),
|
|
3080
|
-
inside: {
|
|
3081
|
-
"table-header": {
|
|
3082
|
-
pattern: RegExp(s),
|
|
3083
|
-
alias: "important",
|
|
3084
|
-
inside: e.languages.markdown
|
|
3085
|
-
},
|
|
3086
|
-
punctuation: /\|/
|
|
3087
|
-
}
|
|
3088
|
-
}
|
|
3089
|
-
}
|
|
3090
|
-
},
|
|
3091
|
-
code: [
|
|
3092
|
-
{
|
|
3093
|
-
// Prefixed by 4 spaces or 1 tab and preceded by an empty line
|
|
3094
|
-
pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
|
|
3095
|
-
lookbehind: !0,
|
|
3096
|
-
alias: "keyword"
|
|
3097
|
-
},
|
|
3098
|
-
{
|
|
3099
|
-
// ```optional language
|
|
3100
|
-
// code block
|
|
3101
|
-
// ```
|
|
3102
|
-
pattern: /^```[\s\S]*?^```$/m,
|
|
3103
|
-
greedy: !0,
|
|
3104
|
-
inside: {
|
|
3105
|
-
"code-block": {
|
|
3106
|
-
pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
|
|
3107
|
-
lookbehind: !0
|
|
3108
|
-
},
|
|
3109
|
-
"code-language": {
|
|
3110
|
-
pattern: /^(```).+/,
|
|
3111
|
-
lookbehind: !0
|
|
3112
|
-
},
|
|
3113
|
-
punctuation: /```/
|
|
3114
|
-
}
|
|
3115
|
-
}
|
|
3116
|
-
],
|
|
3117
|
-
title: [
|
|
3118
|
-
{
|
|
3119
|
-
// title 1
|
|
3120
|
-
// =======
|
|
3121
|
-
// title 2
|
|
3122
|
-
// -------
|
|
3123
|
-
pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,
|
|
3124
|
-
alias: "important",
|
|
3125
|
-
inside: {
|
|
3126
|
-
punctuation: /==+$|--+$/
|
|
3127
|
-
}
|
|
3128
|
-
},
|
|
3129
|
-
{
|
|
3130
|
-
// # title 1
|
|
3131
|
-
// ###### title 6
|
|
3132
|
-
pattern: /(^\s*)#.+/m,
|
|
3133
|
-
lookbehind: !0,
|
|
3134
|
-
alias: "important",
|
|
3135
|
-
inside: {
|
|
3136
|
-
punctuation: /^#+|#+$/
|
|
3137
|
-
}
|
|
3138
|
-
}
|
|
3139
|
-
],
|
|
3140
|
-
hr: {
|
|
3141
|
-
// ***
|
|
3142
|
-
// ---
|
|
3143
|
-
// * * *
|
|
3144
|
-
// -----------
|
|
3145
|
-
pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,
|
|
3146
|
-
lookbehind: !0,
|
|
3147
|
-
alias: "punctuation"
|
|
3148
|
-
},
|
|
3149
|
-
list: {
|
|
3150
|
-
// * item
|
|
3151
|
-
// + item
|
|
3152
|
-
// - item
|
|
3153
|
-
// 1. item
|
|
3154
|
-
pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
|
|
3155
|
-
lookbehind: !0,
|
|
3156
|
-
alias: "punctuation"
|
|
3157
|
-
},
|
|
3158
|
-
"url-reference": {
|
|
3159
|
-
// [id]: http://example.com "Optional title"
|
|
3160
|
-
// [id]: http://example.com 'Optional title'
|
|
3161
|
-
// [id]: http://example.com (Optional title)
|
|
3162
|
-
// [id]: <http://example.com> "Optional title"
|
|
3163
|
-
pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,
|
|
3164
|
-
inside: {
|
|
3165
|
-
variable: {
|
|
3166
|
-
pattern: /^(!?\[)[^\]]+/,
|
|
3167
|
-
lookbehind: !0
|
|
3168
|
-
},
|
|
3169
|
-
string: /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
|
|
3170
|
-
punctuation: /^[\[\]!:]|[<>]/
|
|
3171
|
-
},
|
|
3172
|
-
alias: "url"
|
|
3173
|
-
},
|
|
3174
|
-
bold: {
|
|
3175
|
-
// **strong**
|
|
3176
|
-
// __strong__
|
|
3177
|
-
// allow one nested instance of italic text using the same delimiter
|
|
3178
|
-
pattern: t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),
|
|
3179
|
-
lookbehind: !0,
|
|
3180
|
-
greedy: !0,
|
|
3181
|
-
inside: {
|
|
3182
|
-
content: {
|
|
3183
|
-
pattern: /(^..)[\s\S]+(?=..$)/,
|
|
3184
|
-
lookbehind: !0,
|
|
3185
|
-
inside: {}
|
|
3186
|
-
// see below
|
|
3187
|
-
},
|
|
3188
|
-
punctuation: /\*\*|__/
|
|
3189
|
-
}
|
|
3190
|
-
},
|
|
3191
|
-
italic: {
|
|
3192
|
-
// *em*
|
|
3193
|
-
// _em_
|
|
3194
|
-
// allow one nested instance of bold text using the same delimiter
|
|
3195
|
-
pattern: t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),
|
|
3196
|
-
lookbehind: !0,
|
|
3197
|
-
greedy: !0,
|
|
3198
|
-
inside: {
|
|
3199
|
-
content: {
|
|
3200
|
-
pattern: /(^.)[\s\S]+(?=.$)/,
|
|
3201
|
-
lookbehind: !0,
|
|
3202
|
-
inside: {}
|
|
3203
|
-
// see below
|
|
3204
|
-
},
|
|
3205
|
-
punctuation: /[*_]/
|
|
3206
|
-
}
|
|
3207
|
-
},
|
|
3208
|
-
strike: {
|
|
3209
|
-
// ~~strike through~~
|
|
3210
|
-
// ~strike~
|
|
3211
|
-
// eslint-disable-next-line regexp/strict
|
|
3212
|
-
pattern: t(/(~~?)(?:(?!~)<inner>)+\2/.source),
|
|
3213
|
-
lookbehind: !0,
|
|
3214
|
-
greedy: !0,
|
|
3215
|
-
inside: {
|
|
3216
|
-
content: {
|
|
3217
|
-
pattern: /(^~~?)[\s\S]+(?=\1$)/,
|
|
3218
|
-
lookbehind: !0,
|
|
3219
|
-
inside: {}
|
|
3220
|
-
// see below
|
|
3221
|
-
},
|
|
3222
|
-
punctuation: /~~?/
|
|
3223
|
-
}
|
|
3224
|
-
},
|
|
3225
|
-
"code-snippet": {
|
|
3226
|
-
// `code`
|
|
3227
|
-
// ``code``
|
|
3228
|
-
pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,
|
|
3229
|
-
lookbehind: !0,
|
|
3230
|
-
greedy: !0,
|
|
3231
|
-
alias: ["code", "keyword"]
|
|
3232
|
-
},
|
|
3233
|
-
url: {
|
|
3234
|
-
// [example](http://example.com "Optional title")
|
|
3235
|
-
// [example][id]
|
|
3236
|
-
// [example] [id]
|
|
3237
|
-
pattern: t(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),
|
|
3238
|
-
lookbehind: !0,
|
|
3239
|
-
greedy: !0,
|
|
3240
|
-
inside: {
|
|
3241
|
-
operator: /^!/,
|
|
3242
|
-
content: {
|
|
3243
|
-
pattern: /(^\[)[^\]]+(?=\])/,
|
|
3244
|
-
lookbehind: !0,
|
|
3245
|
-
inside: {}
|
|
3246
|
-
// see below
|
|
3247
|
-
},
|
|
3248
|
-
variable: {
|
|
3249
|
-
pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/,
|
|
3250
|
-
lookbehind: !0
|
|
3251
|
-
},
|
|
3252
|
-
url: {
|
|
3253
|
-
pattern: /(^\]\()[^\s)]+/,
|
|
3254
|
-
lookbehind: !0
|
|
3255
|
-
},
|
|
3256
|
-
string: {
|
|
3257
|
-
pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,
|
|
3258
|
-
lookbehind: !0
|
|
3259
|
-
}
|
|
3260
|
-
}
|
|
3261
|
-
}
|
|
3262
|
-
}), ["url", "bold", "italic", "strike"].forEach(function(m) {
|
|
3263
|
-
["url", "bold", "italic", "strike", "code-snippet"].forEach(function(p) {
|
|
3264
|
-
m !== p && (e.languages.markdown[m].inside.content.inside[p] = e.languages.markdown[p]);
|
|
3265
|
-
});
|
|
3266
|
-
}), e.hooks.add("after-tokenize", function(m) {
|
|
3267
|
-
if (m.language !== "markdown" && m.language !== "md")
|
|
3268
|
-
return;
|
|
3269
|
-
function p(_) {
|
|
3270
|
-
if (!(!_ || typeof _ == "string"))
|
|
3271
|
-
for (var w = 0, x = _.length; w < x; w++) {
|
|
3272
|
-
var v = _[w];
|
|
3273
|
-
if (v.type !== "code") {
|
|
3274
|
-
p(v.content);
|
|
3275
|
-
continue;
|
|
3276
|
-
}
|
|
3277
|
-
var y = v.content[1], S = v.content[3];
|
|
3278
|
-
if (y && S && y.type === "code-language" && S.type === "code-block" && typeof y.content == "string") {
|
|
3279
|
-
var a = y.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp");
|
|
3280
|
-
a = (/[a-z][\w-]*/i.exec(a) || [""])[0].toLowerCase();
|
|
3281
|
-
var n = "language-" + a;
|
|
3282
|
-
S.alias ? typeof S.alias == "string" ? S.alias = [S.alias, n] : S.alias.push(n) : S.alias = [n];
|
|
3283
|
-
}
|
|
3284
|
-
}
|
|
3285
|
-
}
|
|
3286
|
-
p(m.tokens);
|
|
3287
|
-
}), e.hooks.add("wrap", function(m) {
|
|
3288
|
-
if (m.type === "code-block") {
|
|
3289
|
-
for (var p = "", _ = 0, w = m.classes.length; _ < w; _++) {
|
|
3290
|
-
var x = m.classes[_], v = /language-(.+)/.exec(x);
|
|
3291
|
-
if (v) {
|
|
3292
|
-
p = v[1];
|
|
3293
|
-
break;
|
|
3294
|
-
}
|
|
3295
|
-
}
|
|
3296
|
-
var y = e.languages[p];
|
|
3297
|
-
if (y)
|
|
3298
|
-
m.content = e.highlight(d(m.content), y, p);
|
|
3299
|
-
else if (p && p !== "none" && e.plugins.autoloader) {
|
|
3300
|
-
var S = "md-" + (/* @__PURE__ */ new Date()).valueOf() + "-" + Math.floor(Math.random() * 1e16);
|
|
3301
|
-
m.attributes.id = S, e.plugins.autoloader.loadLanguages(p, function() {
|
|
3302
|
-
var a = document.getElementById(S);
|
|
3303
|
-
a && (a.innerHTML = e.highlight(a.textContent, e.languages[p], p));
|
|
3304
|
-
});
|
|
3305
|
-
}
|
|
3306
|
-
}
|
|
3307
|
-
});
|
|
3308
|
-
var h = RegExp(e.languages.markup.tag.pattern.source, "gi"), r = {
|
|
3309
|
-
amp: "&",
|
|
3310
|
-
lt: "<",
|
|
3311
|
-
gt: ">",
|
|
3312
|
-
quot: '"'
|
|
3313
|
-
}, c = String.fromCodePoint || String.fromCharCode;
|
|
3314
|
-
function d(m) {
|
|
3315
|
-
var p = m.replace(h, "");
|
|
3316
|
-
return p = p.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function(_, w) {
|
|
3317
|
-
if (w = w.toLowerCase(), w[0] === "#") {
|
|
3318
|
-
var x;
|
|
3319
|
-
return w[1] === "x" ? x = parseInt(w.slice(2), 16) : x = Number(w.slice(1)), c(x);
|
|
3320
|
-
} else {
|
|
3321
|
-
var v = r[w];
|
|
3322
|
-
return v || _;
|
|
3323
|
-
}
|
|
3324
|
-
}), p;
|
|
3325
|
-
}
|
|
3326
|
-
e.languages.md = e.languages.markdown;
|
|
3327
|
-
})(Prism);
|
|
3328
|
-
const Pe = ["data-lang"], ze = { class: "code-block-header" }, Me = { class: "lang-label" }, Be = { class: "op-btn-group" }, Ue = { key: 1 }, He = ["innerHTML"], Ge = {
|
|
3329
|
-
key: 0,
|
|
3330
|
-
class: "iframe-wrapper"
|
|
3331
|
-
}, je = ["srcdoc"], qe = '<svg width="16" height="16" viewBox="0 0 16 16"><path fill="currentColor" d="M4 2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2zm2 0v10h6V2H6zm-1 2V2a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1v-8zm-2 2H2V14a2 2 0 0 0 2 2h6v-2a2 2 0 0 0-2-2H4V4zm0 0v10a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4H4z"/></svg>', Ze = '<svg width="17" height="17" viewBox="0 0 20 20"><path fill="currentColor" d="M2 5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5zm2 0v10h12V5H4zm3.6 3.55l1.4 1.45l-1.4 1.45L7 11.38l2-2l-2-2zm5.4.83l-1.4-1.45L13 6.62l2 2l-2 2z"/></svg>', Ye = '<svg width="17" height="17" viewBox="0 0 20 20"><path fill="currentColor" d="M6.23 4.81a1 1 0 0 1 1.41 0L10 7.17l2.36-2.36a1 1 0 0 1 1.41 1.41L11.41 8.59l2.36 2.36a1 1 0 1 1-1.41 1.41L10 10l-2.36 2.36a1 1 0 0 1-1.41-1.41L8.59 8.59 6.23 6.23a1 1 0 0 1 0-1.41z"/></svg>', Xe = /* @__PURE__ */ Ae({
|
|
3332
|
-
__name: "CodeBlock",
|
|
3333
|
-
props: {
|
|
3334
|
-
code: {},
|
|
3335
|
-
language: {}
|
|
3336
|
-
},
|
|
3337
|
-
setup(e) {
|
|
3338
|
-
const o = e, t = Z(!1), s = Z(!1);
|
|
3339
|
-
function b() {
|
|
3340
|
-
return o.language.toLowerCase() === "html" || o.language.toLowerCase() === "markup";
|
|
3341
|
-
}
|
|
3342
|
-
function E() {
|
|
3343
|
-
const p = o.language || "plaintext";
|
|
3344
|
-
return H.languages[p] ? H.highlight(o.code, H.languages[p], p) : H.util.encode(o.code);
|
|
3345
|
-
}
|
|
3346
|
-
const h = Z(""), r = () => {
|
|
3347
|
-
h.value = E();
|
|
3348
|
-
};
|
|
3349
|
-
r(), ve(() => [o.code, o.language], () => {
|
|
3350
|
-
r();
|
|
3351
|
-
});
|
|
3352
|
-
const c = async () => {
|
|
3353
|
-
try {
|
|
3354
|
-
await navigator.clipboard.writeText(o.code), t.value = !0, setTimeout(() => {
|
|
3355
|
-
t.value = !1;
|
|
3356
|
-
}, 1700);
|
|
3357
|
-
} catch (p) {
|
|
3358
|
-
console.error("复制失败:", p);
|
|
3359
|
-
}
|
|
3360
|
-
}, d = () => {
|
|
3361
|
-
s.value = !0;
|
|
3362
|
-
}, m = () => {
|
|
3363
|
-
s.value = !1;
|
|
3364
|
-
};
|
|
3365
|
-
return (p, _) => (D(), $("div", {
|
|
3366
|
-
class: "code-block-wrapper",
|
|
3367
|
-
"data-lang": e.language
|
|
3368
|
-
}, [
|
|
3369
|
-
L("div", ze, [
|
|
3370
|
-
L("span", Me, _e(e.language.toUpperCase()), 1),
|
|
3371
|
-
L("div", Be, [
|
|
3372
|
-
L("button", {
|
|
3373
|
-
class: X(["copy-code-button", { copied: t.value }]),
|
|
3374
|
-
type: "button",
|
|
3375
|
-
title: "复制代码",
|
|
3376
|
-
onClick: c
|
|
3377
|
-
}, [
|
|
3378
|
-
t.value ? (D(), $("span", Ue, "已复制")) : (D(), $("span", {
|
|
3379
|
-
key: 0,
|
|
3380
|
-
innerHTML: qe
|
|
3381
|
-
}))
|
|
3382
|
-
], 2),
|
|
3383
|
-
b() && !s.value ? (D(), $("button", {
|
|
3384
|
-
key: 0,
|
|
3385
|
-
class: "preview-html-button",
|
|
3386
|
-
type: "button",
|
|
3387
|
-
title: "预览 HTML",
|
|
3388
|
-
onClick: d,
|
|
3389
|
-
innerHTML: Ze
|
|
3390
|
-
})) : Y("", !0),
|
|
3391
|
-
s.value ? (D(), $("button", {
|
|
3392
|
-
key: 1,
|
|
3393
|
-
class: "close-preview-button",
|
|
3394
|
-
type: "button",
|
|
3395
|
-
title: "关闭预览",
|
|
3396
|
-
onClick: m,
|
|
3397
|
-
innerHTML: Ye
|
|
3398
|
-
})) : Y("", !0)
|
|
3399
|
-
])
|
|
3400
|
-
]),
|
|
3401
|
-
we(L("pre", {
|
|
3402
|
-
class: X(`language-${e.language}`)
|
|
3403
|
-
}, [
|
|
3404
|
-
L("code", {
|
|
3405
|
-
class: X(`language-${e.language}`),
|
|
3406
|
-
innerHTML: h.value
|
|
3407
|
-
}, null, 10, He)
|
|
3408
|
-
], 2), [
|
|
3409
|
-
[ke, !s.value]
|
|
3410
|
-
]),
|
|
3411
|
-
s.value ? (D(), $("div", Ge, [
|
|
3412
|
-
L("iframe", {
|
|
3413
|
-
class: "html-preview-iframe",
|
|
3414
|
-
srcdoc: e.code,
|
|
3415
|
-
sandbox: "allow-scripts allow-forms allow-popups allow-modals allow-same-origin"
|
|
3416
|
-
}, null, 8, je)
|
|
3417
|
-
])) : Y("", !0)
|
|
3418
|
-
], 8, Pe));
|
|
3419
|
-
}
|
|
3420
|
-
}), Ve = /* @__PURE__ */ Te(Xe, [["__scopeId", "data-v-a3e86bb9"]]), Qe = {
|
|
3421
|
-
name: "codeblock",
|
|
3422
|
-
priority: 70,
|
|
3423
|
-
test: (e) => e.type !== "tag" || e.name !== "pre" ? !1 : !!e.children?.some(
|
|
3424
|
-
(t) => t.type === "tag" && t.name === "code"
|
|
3425
|
-
),
|
|
3426
|
-
render: (e, o, t) => {
|
|
3427
|
-
const s = e.children?.find(
|
|
3428
|
-
(d) => d.type === "tag" && d.name === "code"
|
|
3429
|
-
);
|
|
3430
|
-
if (!s)
|
|
3431
|
-
return ee("pre", {}, "");
|
|
3432
|
-
const E = (s.attribs?.class || "").match(/language-(\w+)/), h = E ? E[1] : "plaintext", r = (d) => d.type === "text" ? d.data || "" : d.children ? d.children.map(r).join("") : "", c = r(s);
|
|
3433
|
-
return ee(Ve, {
|
|
3434
|
-
code: c,
|
|
3435
|
-
language: h
|
|
3436
|
-
});
|
|
3437
|
-
}
|
|
3438
|
-
};
|
|
3439
|
-
export {
|
|
3440
|
-
Qe as CodeBlockPlugin
|
|
3441
|
-
};
|