file-viewer3 1.0.26 → 2.0.0
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/README.en.md +7 -377
- package/README.md +8 -352
- package/dist/file-viewer3.css +1 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +27 -129
- package/dist/components/3MFLoader.js +0 -527
- package/dist/components/AMFLoader.js +0 -188
- package/dist/components/ArchiveViewer.js +0 -526
- package/dist/components/AudioViewer.js +0 -66
- package/dist/components/CadViewer.js +0 -9040
- package/dist/components/CodeViewer.js +0 -151
- package/dist/components/ColladaLoader.js +0 -2282
- package/dist/components/DrawingViewer.js +0 -295
- package/dist/components/EdaViewer.js +0 -630
- package/dist/components/EmailViewer.js +0 -276
- package/dist/components/EpubViewer.js +0 -172
- package/dist/components/FBXLoader.js +0 -1574
- package/dist/components/GLTFLoader.js +0 -1383
- package/dist/components/ImageViewer.js +0 -1519
- package/dist/components/KMZLoader.js +0 -45
- package/dist/components/MarkdownViewer.js +0 -1476
- package/dist/components/ModelViewer.js +0 -797
- package/dist/components/OBJLoader.js +0 -287
- package/dist/components/OfdViewer.js +0 -133
- package/dist/components/PCDLoader.js +0 -141
- package/dist/components/PLYLoader.js +0 -305
- package/dist/components/PdfView.js +0 -27667
- package/dist/components/PptxRender.js +0 -11217
- package/dist/components/STLLoader.js +0 -83
- package/dist/components/TDSLoader.js +0 -228
- package/dist/components/TypstViewer.js +0 -1697
- package/dist/components/USDLoader.js +0 -2526
- package/dist/components/UmdViewer.js +0 -1873
- package/dist/components/VRMLLoader.js +0 -6422
- package/dist/components/VTKLoader.js +0 -337
- package/dist/components/XYZLoader.js +0 -30
- package/dist/components/XlsxTable.js +0 -7879
- package/dist/components/__vite-browser-external.js +0 -7
- package/dist/components/_plugin-vue_export-helper.js +0 -8
- package/dist/components/ar-SA-G6X2FPQ2.js +0 -523
- package/dist/components/arc.js +0 -79
- package/dist/components/architecture-7EHR7CIX.js +0 -3
- package/dist/components/architectureDiagram-3BPJPVTR.js +0 -4096
- package/dist/components/archive.js +0 -24
- package/dist/components/asyncToGenerator.js +0 -29
- package/dist/components/audio.js +0 -19
- package/dist/components/az-AZ-76LH7QW2.js +0 -523
- package/dist/components/bash.js +0 -169
- package/dist/components/bg-BG-XCXSNQG7.js +0 -523
- package/dist/components/blockDiagram-GPEHLZMM.js +0 -3357
- package/dist/components/bn-BD-2XOGV67Q.js +0 -523
- package/dist/components/c4Diagram-AAUBKEIU.js +0 -2957
- package/dist/components/ca-ES-6MX7JW3Y.js +0 -523
- package/dist/components/cad.js +0 -23
- package/dist/components/cfb.js +0 -1174
- package/dist/components/channel.js +0 -5
- package/dist/components/chunk-2J33WTMH.js +0 -26
- package/dist/components/chunk-3OPIFGDE.js +0 -4167
- package/dist/components/chunk-4BX2VUAB.js +0 -19
- package/dist/components/chunk-55IACEB6.js +0 -9
- package/dist/components/chunk-5ZQYHXKU.js +0 -669
- package/dist/components/chunk-6U3AYISY.js +0 -624
- package/dist/components/chunk-727SXJPM.js +0 -3356
- package/dist/components/chunk-AGHRB4JF.js +0 -324
- package/dist/components/chunk-AQP2D5EJ.js +0 -2055
- package/dist/components/chunk-BSJP7CBP.js +0 -83
- package/dist/components/chunk-CSCIHK7Q.js +0 -3500
- package/dist/components/chunk-EIO257PC.js +0 -1836
- package/dist/components/chunk-FMBD7UC4.js +0 -5
- package/dist/components/chunk-K2UTITRG.js +0 -17627
- package/dist/components/chunk-KSCS5N6A.js +0 -572
- package/dist/components/chunk-L5ZTLDWV.js +0 -40
- package/dist/components/chunk-LZXEDZCA.js +0 -60
- package/dist/components/chunk-ND2GUHAM.js +0 -61
- package/dist/components/chunk-NNHCCRGN.js +0 -20425
- package/dist/components/chunk-NZK2D7GU.js +0 -68
- package/dist/components/chunk-O5CBEL6O.js +0 -1894
- package/dist/components/chunk-QZHKN3VN.js +0 -12
- package/dist/components/chunk-SRAX5OIU.js +0 -22
- package/dist/components/chunk-WU5MYG2G.js +0 -14
- package/dist/components/chunk-XPW4576I.js +0 -1146
- package/dist/components/chunk-Z3N5DIM6.js +0 -59
- package/dist/components/chunk-ZUYEQ4TG.js +0 -22
- package/dist/components/chunk.js +0 -23
- package/dist/components/classDiagram-4FO5ZUOK.js +0 -29
- package/dist/components/classDiagram-v2-Q7XG4LA2.js +0 -29
- package/dist/components/compiler.js +0 -2
- package/dist/components/core.js +0 -845
- package/dist/components/cose-bilkent-S5V4N54A.js +0 -2268
- package/dist/components/cpp.js +0 -225
- package/dist/components/cs-CZ-2BRQDIVT.js +0 -523
- package/dist/components/csharp.js +0 -260
- package/dist/components/css.js +0 -140
- package/dist/components/cytoscape.esm.js +0 -18114
- package/dist/components/da-DK-5WZEPLOC.js +0 -523
- package/dist/components/dagre-BM42HDAG.js +0 -325
- package/dist/components/dagre.js +0 -1936
- package/dist/components/de-DE-XR44H4JA.js +0 -523
- package/dist/components/defaultLocale.js +0 -201
- package/dist/components/defineProperty.js +0 -50
- package/dist/components/diagram-2AECGRRQ.js +0 -229
- package/dist/components/diagram-5GNKFQAL.js +0 -108
- package/dist/components/diagram-KO2AKTUF.js +0 -443
- package/dist/components/diagram-LMA3HP47.js +0 -139
- package/dist/components/diagram-OG6HWLK6.js +0 -541
- package/dist/components/diff.js +0 -39
- package/dist/components/directory-open-01563666.js +0 -26
- package/dist/components/directory-open-4ed118d0.js +0 -83
- package/dist/components/dist.js +0 -50
- package/dist/components/dist2.js +0 -3291
- package/dist/components/dist3.js +0 -1593
- package/dist/components/documentSearch.js +0 -378
- package/dist/components/docx-preview.js +0 -3113
- package/dist/components/drawing.js +0 -19
- package/dist/components/ebook.js +0 -16
- package/dist/components/eda.js +0 -20
- package/dist/components/el-GR-BZB4AONW.js +0 -523
- package/dist/components/email.js +0 -21
- package/dist/components/en-B4ZKOASM.js +0 -3
- package/dist/components/erDiagram-TEJ5UH35.js +0 -1719
- package/dist/components/es-ES-U4NZUMDT.js +0 -523
- package/dist/components/eu-ES-A7QVB2H4.js +0 -523
- package/dist/components/eventmodeling-FCH6USID.js +0 -3
- package/dist/components/fa-IR-HGAKTJCU.js +0 -523
- package/dist/components/fflate.module.js +0 -323
- package/dist/components/fi-FI-Z5N7JZ37.js +0 -523
- package/dist/components/file-open-002ab408.js +0 -38
- package/dist/components/file-open-7c801643.js +0 -24
- package/dist/components/file-save-3189631c.js +0 -40
- package/dist/components/file-save-745eba88.js +0 -36
- package/dist/components/flowDiagram-I6XJVG4X.js +0 -4181
- package/dist/components/fr-FR-RHASNOE6.js +0 -523
- package/dist/components/ganttDiagram-6RSMTGT7.js +0 -2182
- package/dist/components/gitGraph-WXDBUCRP.js +0 -3
- package/dist/components/gitGraphDiagram-PVQCEYII.js +0 -788
- package/dist/components/gl-ES-HMX3MZ6V.js +0 -523
- package/dist/components/global-compiler.js +0 -23
- package/dist/components/global-renderer.js +0 -23
- package/dist/components/go.js +0 -140
- package/dist/components/graphlib.js +0 -1267
- package/dist/components/he-IL-6SHJWFNN.js +0 -523
- package/dist/components/hi-IN-IWLTKZ5I.js +0 -523
- package/dist/components/hu-HU-A5ZG7DT2.js +0 -523
- package/dist/components/id-ID-SAP4L64H.js +0 -523
- package/dist/components/image-GAAHSSAO.js +0 -3
- package/dist/components/image-blob-reduce.esm.js +0 -1429
- package/dist/components/image.js +0 -17
- package/dist/components/info-J43DQDTF.js +0 -3
- package/dist/components/infoDiagram-5YYISTIA.js +0 -26
- package/dist/components/ini.js +0 -88
- package/dist/components/init.js +0 -15
- package/dist/components/ishikawaDiagram-YF4QCWOH.js +0 -718
- package/dist/components/it-IT-JPQ66NNP.js +0 -523
- package/dist/components/ja-JP-DBVTYXUO.js +0 -523
- package/dist/components/java.js +0 -169
- package/dist/components/javascript.js +0 -436
- package/dist/components/journeyDiagram-JHISSGLW.js +0 -885
- package/dist/components/json.js +0 -36
- package/dist/components/jszip.min.js +0 -3033
- package/dist/components/kaa-6HZHGXH3.js +0 -523
- package/dist/components/kab-KAB-ZGHBKWFO.js +0 -523
- package/dist/components/kanban-definition-UN3LZRKU.js +0 -986
- package/dist/components/katex.js +0 -21979
- package/dist/components/kk-KZ-P5N5QNE5.js +0 -523
- package/dist/components/km-KH-HSX4SM5Z.js +0 -523
- package/dist/components/ko-KR-MTYHY66A.js +0 -523
- package/dist/components/ku-TR-6OUDTVRD.js +0 -523
- package/dist/components/lib.js +0 -4877
- package/dist/components/libarchive.js +0 -360
- package/dist/components/linear.js +0 -289
- package/dist/components/lt-LT-XHIRWOB4.js +0 -523
- package/dist/components/lv-LV-5QDEKY6T.js +0 -523
- package/dist/components/markdown.js +0 -181
- package/dist/components/md.js +0 -17
- package/dist/components/mermaid-parser.core.js +0 -328
- package/dist/components/mindmap-definition-RKZ34NQL.js +0 -1016
- package/dist/components/model.js +0 -21
- package/dist/components/mp4.js +0 -12
- package/dist/components/mr-IN-CRQNXWMA.js +0 -523
- package/dist/components/my-MM-5M5IBNSE.js +0 -523
- package/dist/components/nb-NO-T6EIAALU.js +0 -523
- package/dist/components/nestedRender.js +0 -158
- package/dist/components/nl-NL-IS3SIHDZ.js +0 -523
- package/dist/components/nn-NO-6E72VCQL.js +0 -523
- package/dist/components/objectSpread2.js +0 -29
- package/dist/components/objectWithoutProperties.js +0 -28
- package/dist/components/oc-FR-POXYY2M6.js +0 -523
- package/dist/components/ofd.js +0 -5261
- package/dist/components/ofd2.js +0 -16
- package/dist/components/ordinal.js +0 -65
- package/dist/components/pa-IN-N4M65BXN.js +0 -523
- package/dist/components/packet-YPE3B663.js +0 -3
- package/dist/components/pdf.js +0 -24
- package/dist/components/percentages-BXMCSKIN.js +0 -3
- package/dist/components/php.js +0 -294
- package/dist/components/pica.js +0 -1009
- package/dist/components/pie-LRSECV5Y.js +0 -3
- package/dist/components/pie.js +0 -47
- package/dist/components/pieDiagram-4H26LBE5.js +0 -130
- package/dist/components/pl-PL-T2D74RX3.js +0 -523
- package/dist/components/postal-mime.js +0 -3146
- package/dist/components/pptx.js +0 -15
- package/dist/components/printLayout.js +0 -42
- package/dist/components/prod.js +0 -21770
- package/dist/components/pt-BR-5N22H2LF.js +0 -523
- package/dist/components/pt-PT-UZXXM6DQ.js +0 -523
- package/dist/components/python.js +0 -238
- package/dist/components/quadrantDiagram-W4KKPZXB.js +0 -1988
- package/dist/components/radar-GUYGQ44K.js +0 -3
- package/dist/components/renderer.js +0 -2
- package/dist/components/requirementDiagram-4Y6WPE33.js +0 -2230
- package/dist/components/ro-RO-JPDTUUEW.js +0 -523
- package/dist/components/rough.esm.js +0 -1355
- package/dist/components/roundRect.js +0 -90
- package/dist/components/ru-RU-B4JR7IUQ.js +0 -523
- package/dist/components/rust.js +0 -169
- package/dist/components/sankeyDiagram-5OEKKPKP.js +0 -972
- package/dist/components/sequenceDiagram-3UESZ5HK.js +0 -4255
- package/dist/components/shared.js +0 -175
- package/dist/components/shared2.js +0 -4
- package/dist/components/si-LK-N5RQ5JYF.js +0 -523
- package/dist/components/sk-SK-C5VTKIMK.js +0 -523
- package/dist/components/sl-SI-NN7IZMDC.js +0 -523
- package/dist/components/sourceLoading.js +0 -134
- package/dist/components/sql.js +0 -118
- package/dist/components/src.js +0 -2664
- package/dist/components/src2.js +0 -10722
- package/dist/components/stateDiagram-AJRCARHV.js +0 -217
- package/dist/components/stateDiagram-v2-BHNVJYJU.js +0 -27
- package/dist/components/subset-shared.chunk.js +0 -3
- package/dist/components/subset-worker.chunk.js +0 -21
- package/dist/components/sv-SE-XGPEYMSR.js +0 -523
- package/dist/components/ta-IN-2NMHFXQM.js +0 -523
- package/dist/components/text.js +0 -20
- package/dist/components/th-TH-HPSO5L25.js +0 -523
- package/dist/components/three.module.js +0 -13134
- package/dist/components/time.js +0 -910
- package/dist/components/timeline-definition-PNZ67QCA.js +0 -1084
- package/dist/components/tr-TR-DEFEU3FU.js +0 -523
- package/dist/components/treeView-BLDUP644.js +0 -3
- package/dist/components/treemap-LRROVOQU.js +0 -3
- package/dist/components/typescript.js +0 -521
- package/dist/components/typst.js +0 -25
- package/dist/components/uk-UA-QMV73CPH.js +0 -523
- package/dist/components/umd.js +0 -16
- package/dist/components/use.js +0 -422
- package/dist/components/util.js +0 -49
- package/dist/components/vennDiagram-CIIHVFJN.js +0 -1880
- package/dist/components/vi-VN-M7AON7JQ.js +0 -523
- package/dist/components/viewerZoom.js +0 -92
- package/dist/components/wardley-L42UT6IY.js +0 -3
- package/dist/components/wardleyDiagram-YWT4CUSO.js +0 -656
- package/dist/components/wasm-pack-shim.js +0 -1711
- package/dist/components/wasm-pack-shim2.js +0 -934
- package/dist/components/wasm.js +0 -97
- package/dist/components/word.js +0 -3055
- package/dist/components/worker-ref.js +0 -16
- package/dist/components/xlsx.js +0 -21
- package/dist/components/xml.js +0 -166
- package/dist/components/xychartDiagram-2RQKCTM6.js +0 -2015
- package/dist/components/yaml.js +0 -144
- package/dist/components/zh-CN-LNUGB5OW.js +0 -523
- package/dist/components/zh-HK-E62DVLB3.js +0 -523
- package/dist/components/zh-TW-RAJ6MFWO.js +0 -523
- package/dist/index.mjs +0 -3293
- package/dist/src/App.vue.d.ts +0 -3
- package/dist/src/compare/CompareApp.vue.d.ts +0 -3
- package/dist/src/compare/main.d.ts +0 -0
- package/dist/src/compare/useSynchronizedScroll.d.ts +0 -7
- package/dist/src/components/HelloWorld.vue.d.ts +0 -3
- package/dist/src/components/utils.d.ts +0 -4
- package/dist/src/main.d.ts +0 -0
- package/dist/src/package/common/printCapability.d.ts +0 -27
- package/dist/src/package/common/printLayout.d.ts +0 -16
- package/dist/src/package/common/sourceLoading.d.ts +0 -10
- package/dist/src/package/common/type.d.ts +0 -544
- package/dist/src/package/common/util.d.ts +0 -5
- package/dist/src/package/common/worker-ref.d.ts +0 -12
- package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +0 -75
- package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +0 -9
- package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +0 -29
- package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +0 -21
- package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +0 -8
- package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +0 -34
- package/dist/src/package/components/FileViewer/index.d.ts +0 -2
- package/dist/src/package/components/FileViewer/util.d.ts +0 -3
- package/dist/src/package/index.d.ts +0 -22
- package/dist/src/package/use/documentLocation.d.ts +0 -15
- package/dist/src/package/use/documentSearch.d.ts +0 -234
- package/dist/src/package/use/index.d.ts +0 -5
- package/dist/src/package/use/loading.d.ts +0 -33
- package/dist/src/package/use/viewerZoom.d.ts +0 -42
- package/dist/src/package/use/worker.d.ts +0 -24
- package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +0 -9
- package/dist/src/package/vendors/archive/cache.d.ts +0 -10
- package/dist/src/package/vendors/archive/fallback.d.ts +0 -9
- package/dist/src/package/vendors/archive/index.d.ts +0 -3
- package/dist/src/package/vendors/archive/shared.d.ts +0 -24
- package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +0 -7
- package/dist/src/package/vendors/audio/index.d.ts +0 -7
- package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +0 -9
- package/dist/src/package/vendors/cad/index.d.ts +0 -8
- package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +0 -15
- package/dist/src/package/vendors/drawing/index.d.ts +0 -7
- package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/ebook/index.d.ts +0 -7
- package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +0 -8
- package/dist/src/package/vendors/eda/index.d.ts +0 -2
- package/dist/src/package/vendors/eda/parser.d.ts +0 -77
- package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +0 -10
- package/dist/src/package/vendors/email/index.d.ts +0 -2
- package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/image/index.d.ts +0 -4
- package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/md/index.d.ts +0 -4
- package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +0 -8
- package/dist/src/package/vendors/model/index.d.ts +0 -3
- package/dist/src/package/vendors/model/shared.d.ts +0 -1
- package/dist/src/package/vendors/mp4/index.d.ts +0 -4
- package/dist/src/package/vendors/nestedRender.d.ts +0 -10
- package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/ofd/index.d.ts +0 -7
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +0 -10
- package/dist/src/package/vendors/pdf/index.d.ts +0 -2
- package/dist/src/package/vendors/pdf/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
- package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +0 -9
- package/dist/src/package/vendors/pptx/index.d.ts +0 -6
- package/dist/src/package/vendors/pptx/options.d.ts +0 -39
- package/dist/src/package/vendors/pptx/support/chart.d.ts +0 -4
- package/dist/src/package/vendors/pptx/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/renders.d.ts +0 -3
- package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +0 -7
- package/dist/src/package/vendors/text/index.d.ts +0 -10
- package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +0 -15
- package/dist/src/package/vendors/typst/index.d.ts +0 -8
- package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +0 -6
- package/dist/src/package/vendors/umd/index.d.ts +0 -7
- package/dist/src/package/vendors/umd/parser.d.ts +0 -30
- package/dist/src/package/vendors/word/doc.d.ts +0 -5
- package/dist/src/package/vendors/word/docx.d.ts +0 -5
- package/dist/src/package/vendors/word/docx.worker.d.ts +0 -1
- package/dist/src/package/vendors/word/index.d.ts +0 -3
- package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +0 -80
- package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +0 -25
- package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/index.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/util.d.ts +0 -3
- package/dist/src/package/vendors/xlsx/worker/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +0 -73
- package/dist/src/package/vendors/xlsx/worker/sheetjs/color.d.ts +0 -2
- package/dist/src/package/vendors/xlsx/worker/sheetjs/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +0 -1
- package/dist/style.css +0 -1
- package/dist/wasm/cad/dwfv-render.wasm +0 -0
- package/dist/wasm/cad/dwg-worker.js +0 -24
- package/dist/wasm/cad/libredwg-web.js +0 -15
- package/dist/wasm/cad/libredwg-web.wasm +0 -0
|
@@ -1,1476 +0,0 @@
|
|
|
1
|
-
import { n as e, t } from "./defineProperty.js";
|
|
2
|
-
import { n, t as r } from "./objectSpread2.js";
|
|
3
|
-
import { n as i, t as a } from "./asyncToGenerator.js";
|
|
4
|
-
import { n as o, r as s, t as c } from "./viewerZoom.js";
|
|
5
|
-
import { t as l } from "./_plugin-vue_export-helper.js";
|
|
6
|
-
import { computed as u, createElementBlock as d, createElementVNode as f, defineComponent as p, normalizeStyle as m, onBeforeUnmount as ee, onMounted as te, openBlock as ne, ref as re, watch as ie } from "vue";
|
|
7
|
-
n(), e(), i();
|
|
8
|
-
var h;
|
|
9
|
-
function g() {
|
|
10
|
-
return {
|
|
11
|
-
async: !1,
|
|
12
|
-
breaks: !1,
|
|
13
|
-
extensions: null,
|
|
14
|
-
gfm: !0,
|
|
15
|
-
hooks: null,
|
|
16
|
-
pedantic: !1,
|
|
17
|
-
renderer: null,
|
|
18
|
-
silent: !1,
|
|
19
|
-
tokenizer: null,
|
|
20
|
-
walkTokens: null
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
var _ = g();
|
|
24
|
-
function ae(e) {
|
|
25
|
-
_ = e;
|
|
26
|
-
}
|
|
27
|
-
var v = { exec: () => null };
|
|
28
|
-
function y(e) {
|
|
29
|
-
let t = [];
|
|
30
|
-
return (n) => {
|
|
31
|
-
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
32
|
-
return i || (i = e(r), t[r] = i), i;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function b(e, t = "") {
|
|
36
|
-
let n = typeof e == "string" ? e : e.source, r = {
|
|
37
|
-
replace: (e, t) => {
|
|
38
|
-
let i = typeof t == "string" ? t : t.source;
|
|
39
|
-
return i = i.replace(x.caret, "$1"), n = n.replace(e, i), r;
|
|
40
|
-
},
|
|
41
|
-
getRegex: () => new RegExp(n, t)
|
|
42
|
-
};
|
|
43
|
-
return r;
|
|
44
|
-
}
|
|
45
|
-
var oe = ((e = "") => {
|
|
46
|
-
try {
|
|
47
|
-
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
48
|
-
} catch (e) {
|
|
49
|
-
return !1;
|
|
50
|
-
}
|
|
51
|
-
})(), x = {
|
|
52
|
-
codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
|
|
53
|
-
outputLinkReplace: /\\([\[\]])/g,
|
|
54
|
-
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
55
|
-
beginningSpace: /^\s+/,
|
|
56
|
-
endingHash: /#$/,
|
|
57
|
-
startingSpaceChar: /^ /,
|
|
58
|
-
endingSpaceChar: / $/,
|
|
59
|
-
nonSpaceChar: /[^ ]/,
|
|
60
|
-
newLineCharGlobal: /\n/g,
|
|
61
|
-
tabCharGlobal: /\t/g,
|
|
62
|
-
multipleSpaceGlobal: /\s+/g,
|
|
63
|
-
blankLine: /^[ \t]*$/,
|
|
64
|
-
doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
|
|
65
|
-
blockquoteStart: /^ {0,3}>/,
|
|
66
|
-
blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
|
|
67
|
-
blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
|
|
68
|
-
listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
|
|
69
|
-
listIsTask: /^\[[ xX]\] +\S/,
|
|
70
|
-
listReplaceTask: /^\[[ xX]\] +/,
|
|
71
|
-
listTaskCheckbox: /\[[ xX]\]/,
|
|
72
|
-
anyLine: /\n.*\n/,
|
|
73
|
-
hrefBrackets: /^<(.*)>$/,
|
|
74
|
-
tableDelimiter: /[:|]/,
|
|
75
|
-
tableAlignChars: /^\||\| *$/g,
|
|
76
|
-
tableRowBlankLine: /\n[ \t]*$/,
|
|
77
|
-
tableAlignRight: /^ *-+: *$/,
|
|
78
|
-
tableAlignCenter: /^ *:-+: *$/,
|
|
79
|
-
tableAlignLeft: /^ *:-+ *$/,
|
|
80
|
-
startATag: /^<a /i,
|
|
81
|
-
endATag: /^<\/a>/i,
|
|
82
|
-
startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
|
|
83
|
-
endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
|
|
84
|
-
startAngleBracket: /^</,
|
|
85
|
-
endAngleBracket: />$/,
|
|
86
|
-
pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
|
|
87
|
-
unicodeAlphaNumeric: /* @__PURE__ */ RegExp("[\\p{L}\\p{N}]", "u"),
|
|
88
|
-
escapeTest: /[&<>"']/,
|
|
89
|
-
escapeReplace: /[&<>"']/g,
|
|
90
|
-
escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
|
|
91
|
-
escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
|
|
92
|
-
caret: /(^|[^\[])\^/g,
|
|
93
|
-
percentDecode: /%25/g,
|
|
94
|
-
findPipe: /\|/g,
|
|
95
|
-
splitPipe: / \|/,
|
|
96
|
-
slashPipe: /\\\|/g,
|
|
97
|
-
carriageReturn: /\r\n|\r/g,
|
|
98
|
-
spaceLine: /^ +$/gm,
|
|
99
|
-
notSpaceStart: /^\S*/,
|
|
100
|
-
endingNewline: /\n$/,
|
|
101
|
-
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
102
|
-
nextBulletRegex: y((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
103
|
-
hrRegex: y((e) => RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),
|
|
104
|
-
fencesBeginRegex: y((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
105
|
-
headingBeginRegex: y((e) => RegExp(`^ {0,${e}}#`)),
|
|
106
|
-
htmlBeginRegex: y((e) => RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`, "i")),
|
|
107
|
-
blockquoteBeginRegex: y((e) => RegExp(`^ {0,${e}}>`))
|
|
108
|
-
}, se = /^(?:[ \t]*(?:\n|$))+/, ce = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, le = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, S = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ue = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, C = / {0,3}(?:[*+-]|\d{1,9}[.)])/, de = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, fe = b(de).replace(/bull/g, C).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), pe = b(de).replace(/bull/g, C).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), w = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, me = /^[^\n]+/, T = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, he = b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", T).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ge = b(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, C).getRegex(), E = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", D = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, _e = b("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", D).replace("tag", E).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ve = b(w).replace("hr", S).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex(), O = {
|
|
109
|
-
blockquote: b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ve).getRegex(),
|
|
110
|
-
code: ce,
|
|
111
|
-
def: he,
|
|
112
|
-
fences: le,
|
|
113
|
-
heading: ue,
|
|
114
|
-
hr: S,
|
|
115
|
-
html: _e,
|
|
116
|
-
lheading: fe,
|
|
117
|
-
list: ge,
|
|
118
|
-
newline: se,
|
|
119
|
-
paragraph: ve,
|
|
120
|
-
table: v,
|
|
121
|
-
text: me
|
|
122
|
-
}, k = b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", S).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex(), ye = r(r({}, O), {}, {
|
|
123
|
-
lheading: pe,
|
|
124
|
-
table: k,
|
|
125
|
-
paragraph: b(w).replace("hr", S).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", k).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex()
|
|
126
|
-
}), be = r(r({}, O), {}, {
|
|
127
|
-
html: b("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", D).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
128
|
-
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
129
|
-
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
130
|
-
fences: v,
|
|
131
|
-
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
132
|
-
paragraph: b(w).replace("hr", S).replace("heading", " *#{1,6} *[^\n]").replace("lheading", fe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
133
|
-
}), xe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Se = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, A = /^( {2,}|\\)\n(?!\s*$)/, Ce = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, j = /* @__PURE__ */ RegExp("[\\p{P}\\p{S}]", "u"), M = /* @__PURE__ */ RegExp("[\\s\\p{P}\\p{S}]", "u"), N = /* @__PURE__ */ RegExp("[^\\s\\p{P}\\p{S}]", "u"), we = b(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, M).getRegex(), P = /* @__PURE__ */ RegExp("(?!~)[\\p{P}\\p{S}]", "u"), Te = /* @__PURE__ */ RegExp("(?!~)[\\s\\p{P}\\p{S}]", "u"), Ee = /* @__PURE__ */ RegExp("(?:[^\\s\\p{P}\\p{S}]|~)", "u"), De = b(/link|precode-code|html/, "g").replace("link", /* @__PURE__ */ RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)", "")).replace("precode-", oe ? "(?<!`)()" : "(^^|[^`])").replace("code", /* @__PURE__ */ RegExp("(?<b>`+)[^`]+\\k<b>(?!`)", "")).replace("html", /<(?! )[^<>]*?>/).getRegex(), F = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Oe = b(F, "u").replace(/punct/g, j).getRegex(), ke = b(F, "u").replace(/punct/g, P).getRegex(), I = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ae = b(I, "gu").replace(/notPunctSpace/g, N).replace(/punctSpace/g, M).replace(/punct/g, j).getRegex(), je = b(I, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Te).replace(/punct/g, P).getRegex(), Me = b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, N).replace(/punctSpace/g, M).replace(/punct/g, j).getRegex(), Ne = b(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, j).getRegex(), Pe = b("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, N).replace(/punctSpace/g, M).replace(/punct/g, j).getRegex(), Fe = b(/\\(punct)/, "gu").replace(/punct/g, j).getRegex(), Ie = b(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Le = b(D).replace("(?:-->|$)", "-->").getRegex(), Re = b("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Le).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), L = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ze = b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", L).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), R = b(/^!?\[(label)\]\[(ref)\]/).replace("label", L).replace("ref", T).getRegex(), z = b(/^!?\[(ref)\](?:\[\])?/).replace("ref", T).getRegex(), Be = b("reflink|nolink(?!\\()", "g").replace("reflink", R).replace("nolink", z).getRegex(), Ve = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, B = {
|
|
134
|
-
_backpedal: v,
|
|
135
|
-
anyPunctuation: Fe,
|
|
136
|
-
autolink: Ie,
|
|
137
|
-
blockSkip: De,
|
|
138
|
-
br: A,
|
|
139
|
-
code: Se,
|
|
140
|
-
del: v,
|
|
141
|
-
delLDelim: v,
|
|
142
|
-
delRDelim: v,
|
|
143
|
-
emStrongLDelim: Oe,
|
|
144
|
-
emStrongRDelimAst: Ae,
|
|
145
|
-
emStrongRDelimUnd: Me,
|
|
146
|
-
escape: xe,
|
|
147
|
-
link: ze,
|
|
148
|
-
nolink: z,
|
|
149
|
-
punctuation: we,
|
|
150
|
-
reflink: R,
|
|
151
|
-
reflinkSearch: Be,
|
|
152
|
-
tag: Re,
|
|
153
|
-
text: Ce,
|
|
154
|
-
url: v
|
|
155
|
-
}, He = r(r({}, B), {}, {
|
|
156
|
-
link: b(/^!?\[(label)\]\((.*?)\)/).replace("label", L).getRegex(),
|
|
157
|
-
reflink: b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", L).getRegex()
|
|
158
|
-
}), V = r(r({}, B), {}, {
|
|
159
|
-
emStrongRDelimAst: je,
|
|
160
|
-
emStrongLDelim: ke,
|
|
161
|
-
delLDelim: Ne,
|
|
162
|
-
delRDelim: Pe,
|
|
163
|
-
url: b(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Ve).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
164
|
-
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
165
|
-
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
166
|
-
text: b(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Ve).getRegex()
|
|
167
|
-
}), Ue = r(r({}, V), {}, {
|
|
168
|
-
br: b(A).replace("{2,}", "*").getRegex(),
|
|
169
|
-
text: b(V.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
170
|
-
}), H = {
|
|
171
|
-
normal: O,
|
|
172
|
-
gfm: ye,
|
|
173
|
-
pedantic: be
|
|
174
|
-
}, U = {
|
|
175
|
-
normal: B,
|
|
176
|
-
gfm: V,
|
|
177
|
-
breaks: Ue,
|
|
178
|
-
pedantic: He
|
|
179
|
-
}, We = {
|
|
180
|
-
"&": "&",
|
|
181
|
-
"<": "<",
|
|
182
|
-
">": ">",
|
|
183
|
-
"\"": """,
|
|
184
|
-
"'": "'"
|
|
185
|
-
}, Ge = (e) => We[e];
|
|
186
|
-
function W(e, t) {
|
|
187
|
-
if (t) {
|
|
188
|
-
if (x.escapeTest.test(e)) return e.replace(x.escapeReplace, Ge);
|
|
189
|
-
} else if (x.escapeTestNoEncode.test(e)) return e.replace(x.escapeReplaceNoEncode, Ge);
|
|
190
|
-
return e;
|
|
191
|
-
}
|
|
192
|
-
function Ke(e) {
|
|
193
|
-
try {
|
|
194
|
-
e = encodeURI(e).replace(x.percentDecode, "%");
|
|
195
|
-
} catch (e) {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
return e;
|
|
199
|
-
}
|
|
200
|
-
function qe(e, t) {
|
|
201
|
-
var n;
|
|
202
|
-
let r = e.replace(x.findPipe, (e, t, n) => {
|
|
203
|
-
let r = !1, i = t;
|
|
204
|
-
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
205
|
-
return r ? "|" : " |";
|
|
206
|
-
}).split(x.splitPipe), i = 0;
|
|
207
|
-
if (r[0].trim() || r.shift(), r.length > 0 && !((n = r.at(-1)) != null && n.trim()) && r.pop(), t) if (r.length > t) r.splice(t);
|
|
208
|
-
else for (; r.length < t;) r.push("");
|
|
209
|
-
for (; i < r.length; i++) r[i] = r[i].trim().replace(x.slashPipe, "|");
|
|
210
|
-
return r;
|
|
211
|
-
}
|
|
212
|
-
function G(e, t, n) {
|
|
213
|
-
let r = e.length;
|
|
214
|
-
if (r === 0) return "";
|
|
215
|
-
let i = 0;
|
|
216
|
-
for (; i < r;) {
|
|
217
|
-
let a = e.charAt(r - i - 1);
|
|
218
|
-
if (a === t && !n) i++;
|
|
219
|
-
else if (a !== t && n) i++;
|
|
220
|
-
else break;
|
|
221
|
-
}
|
|
222
|
-
return e.slice(0, r - i);
|
|
223
|
-
}
|
|
224
|
-
function Je(e) {
|
|
225
|
-
let t = e.split("\n"), n = t.length - 1;
|
|
226
|
-
for (; n >= 0 && x.blankLine.test(t[n]);) n--;
|
|
227
|
-
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
228
|
-
}
|
|
229
|
-
function Ye(e, t) {
|
|
230
|
-
if (e.indexOf(t[1]) === -1) return -1;
|
|
231
|
-
let n = 0;
|
|
232
|
-
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
233
|
-
else if (e[r] === t[0]) n++;
|
|
234
|
-
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
235
|
-
return n > 0 ? -2 : -1;
|
|
236
|
-
}
|
|
237
|
-
function Xe(e, t = 0) {
|
|
238
|
-
let n = t, r = "";
|
|
239
|
-
for (let t of e) if (t === " ") {
|
|
240
|
-
let e = 4 - n % 4;
|
|
241
|
-
r += " ".repeat(e), n += e;
|
|
242
|
-
} else r += t, n++;
|
|
243
|
-
return r;
|
|
244
|
-
}
|
|
245
|
-
function Ze(e, t, n, r, i) {
|
|
246
|
-
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1");
|
|
247
|
-
r.state.inLink = !0;
|
|
248
|
-
let c = {
|
|
249
|
-
type: e[0].charAt(0) === "!" ? "image" : "link",
|
|
250
|
-
raw: n,
|
|
251
|
-
href: a,
|
|
252
|
-
title: o,
|
|
253
|
-
text: s,
|
|
254
|
-
tokens: r.inlineTokens(s)
|
|
255
|
-
};
|
|
256
|
-
return r.state.inLink = !1, c;
|
|
257
|
-
}
|
|
258
|
-
function Qe(e, t, n) {
|
|
259
|
-
let r = e.match(n.other.indentCodeCompensation);
|
|
260
|
-
if (r === null) return t;
|
|
261
|
-
let i = r[1];
|
|
262
|
-
return t.split("\n").map((e) => {
|
|
263
|
-
let t = e.match(n.other.beginningSpace);
|
|
264
|
-
if (t === null) return e;
|
|
265
|
-
let [r] = t;
|
|
266
|
-
return r.length >= i.length ? e.slice(i.length) : e;
|
|
267
|
-
}).join("\n");
|
|
268
|
-
}
|
|
269
|
-
var K = class {
|
|
270
|
-
constructor(e) {
|
|
271
|
-
t(this, "options", void 0), t(this, "rules", void 0), t(this, "lexer", void 0), this.options = e || _;
|
|
272
|
-
}
|
|
273
|
-
space(e) {
|
|
274
|
-
let t = this.rules.block.newline.exec(e);
|
|
275
|
-
if (t && t[0].length > 0) return {
|
|
276
|
-
type: "space",
|
|
277
|
-
raw: t[0]
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
code(e) {
|
|
281
|
-
let t = this.rules.block.code.exec(e);
|
|
282
|
-
if (t) {
|
|
283
|
-
let e = this.options.pedantic ? t[0] : Je(t[0]);
|
|
284
|
-
return {
|
|
285
|
-
type: "code",
|
|
286
|
-
raw: e,
|
|
287
|
-
codeBlockStyle: "indented",
|
|
288
|
-
text: e.replace(this.rules.other.codeRemoveIndent, "")
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
fences(e) {
|
|
293
|
-
let t = this.rules.block.fences.exec(e);
|
|
294
|
-
if (t) {
|
|
295
|
-
let e = t[0], n = Qe(e, t[3] || "", this.rules);
|
|
296
|
-
return {
|
|
297
|
-
type: "code",
|
|
298
|
-
raw: e,
|
|
299
|
-
lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
|
|
300
|
-
text: n
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
heading(e) {
|
|
305
|
-
let t = this.rules.block.heading.exec(e);
|
|
306
|
-
if (t) {
|
|
307
|
-
let e = t[2].trim();
|
|
308
|
-
if (this.rules.other.endingHash.test(e)) {
|
|
309
|
-
let t = G(e, "#");
|
|
310
|
-
(this.options.pedantic || !t || this.rules.other.endingSpaceChar.test(t)) && (e = t.trim());
|
|
311
|
-
}
|
|
312
|
-
return {
|
|
313
|
-
type: "heading",
|
|
314
|
-
raw: G(t[0], "\n"),
|
|
315
|
-
depth: t[1].length,
|
|
316
|
-
text: e,
|
|
317
|
-
tokens: this.lexer.inline(e)
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
hr(e) {
|
|
322
|
-
let t = this.rules.block.hr.exec(e);
|
|
323
|
-
if (t) return {
|
|
324
|
-
type: "hr",
|
|
325
|
-
raw: G(t[0], "\n")
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
blockquote(e) {
|
|
329
|
-
let t = this.rules.block.blockquote.exec(e);
|
|
330
|
-
if (t) {
|
|
331
|
-
let e = G(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
332
|
-
for (; e.length > 0;) {
|
|
333
|
-
let t = !1, a = [], o;
|
|
334
|
-
for (o = 0; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
335
|
-
else if (!t) a.push(e[o]);
|
|
336
|
-
else break;
|
|
337
|
-
e = e.slice(o);
|
|
338
|
-
let s = a.join("\n"), c = s.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
339
|
-
n = n ? `${n}
|
|
340
|
-
${s}` : s, r = r ? `${r}
|
|
341
|
-
${c}` : c;
|
|
342
|
-
let l = this.lexer.state.top;
|
|
343
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = l, e.length === 0) break;
|
|
344
|
-
let u = i.at(-1);
|
|
345
|
-
if ((u == null ? void 0 : u.type) === "code") break;
|
|
346
|
-
if ((u == null ? void 0 : u.type) === "blockquote") {
|
|
347
|
-
let t = u, a = t.raw + "\n" + e.join("\n"), o = this.blockquote(a);
|
|
348
|
-
i[i.length - 1] = o, n = n.substring(0, n.length - t.raw.length) + o.raw, r = r.substring(0, r.length - t.text.length) + o.text;
|
|
349
|
-
break;
|
|
350
|
-
} else if ((u == null ? void 0 : u.type) === "list") {
|
|
351
|
-
let t = u, a = t.raw + "\n" + e.join("\n"), o = this.list(a);
|
|
352
|
-
i[i.length - 1] = o, n = n.substring(0, n.length - u.raw.length) + o.raw, r = r.substring(0, r.length - t.raw.length) + o.raw, e = a.substring(i.at(-1).raw.length).split("\n");
|
|
353
|
-
continue;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return {
|
|
357
|
-
type: "blockquote",
|
|
358
|
-
raw: n,
|
|
359
|
-
tokens: i,
|
|
360
|
-
text: r
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
list(e) {
|
|
365
|
-
let t = this.rules.block.list.exec(e);
|
|
366
|
-
if (t) {
|
|
367
|
-
let n = t[1].trim(), r = n.length > 1, i = {
|
|
368
|
-
type: "list",
|
|
369
|
-
raw: "",
|
|
370
|
-
ordered: r,
|
|
371
|
-
start: r ? +n.slice(0, -1) : "",
|
|
372
|
-
loose: !1,
|
|
373
|
-
items: []
|
|
374
|
-
};
|
|
375
|
-
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
376
|
-
let a = this.rules.other.listItemRegex(n), o = !1;
|
|
377
|
-
for (; e;) {
|
|
378
|
-
let n = !1, r = "", s = "";
|
|
379
|
-
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
380
|
-
r = t[0], e = e.substring(r.length);
|
|
381
|
-
let c = Xe(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
|
|
382
|
-
if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = c.search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
|
|
383
|
-
let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), f = this.rules.other.blockquoteBeginRegex(d);
|
|
384
|
-
for (; e;) {
|
|
385
|
-
let p = e.split("\n", 1)[0], m;
|
|
386
|
-
if (l = p, this.options.pedantic ? (l = l.replace(this.rules.other.listReplaceNesting, " "), m = l) : m = l.replace(this.rules.other.tabCharGlobal, " "), i.test(l) || a.test(l) || o.test(l) || f.test(l) || t.test(l) || n.test(l)) break;
|
|
387
|
-
if (m.search(this.rules.other.nonSpaceChar) >= d || !l.trim()) s += "\n" + m.slice(d);
|
|
388
|
-
else {
|
|
389
|
-
if (u || c.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || i.test(c) || a.test(c) || n.test(c)) break;
|
|
390
|
-
s += "\n" + l;
|
|
391
|
-
}
|
|
392
|
-
u = !l.trim(), r += p + "\n", e = e.substring(p.length + 1), c = m.slice(d);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(r) && (o = !0)), i.items.push({
|
|
396
|
-
type: "list_item",
|
|
397
|
-
raw: r,
|
|
398
|
-
task: !!this.options.gfm && this.rules.other.listIsTask.test(s),
|
|
399
|
-
loose: !1,
|
|
400
|
-
text: s,
|
|
401
|
-
tokens: []
|
|
402
|
-
}), i.raw += r;
|
|
403
|
-
}
|
|
404
|
-
let s = i.items.at(-1);
|
|
405
|
-
if (s) s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
|
|
406
|
-
else return;
|
|
407
|
-
i.raw = i.raw.trimEnd();
|
|
408
|
-
for (let e of i.items) {
|
|
409
|
-
this.lexer.state.top = !1, e.tokens = this.lexer.blockTokens(e.text, []);
|
|
410
|
-
let t = e.tokens[0];
|
|
411
|
-
if (e.task && ((t == null ? void 0 : t.type) === "text" || (t == null ? void 0 : t.type) === "paragraph")) {
|
|
412
|
-
e.text = e.text.replace(this.rules.other.listReplaceTask, ""), t.raw = t.raw.replace(this.rules.other.listReplaceTask, ""), t.text = t.text.replace(this.rules.other.listReplaceTask, "");
|
|
413
|
-
for (let e = this.lexer.inlineQueue.length - 1; e >= 0; e--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)) {
|
|
414
|
-
this.lexer.inlineQueue[e].src = this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask, "");
|
|
415
|
-
break;
|
|
416
|
-
}
|
|
417
|
-
let n = this.rules.other.listTaskCheckbox.exec(e.raw);
|
|
418
|
-
if (n) {
|
|
419
|
-
let t = {
|
|
420
|
-
type: "checkbox",
|
|
421
|
-
raw: n[0] + " ",
|
|
422
|
-
checked: n[0] !== "[ ]"
|
|
423
|
-
};
|
|
424
|
-
e.checked = t.checked, i.loose ? e.tokens[0] && ["paragraph", "text"].includes(e.tokens[0].type) && "tokens" in e.tokens[0] && e.tokens[0].tokens ? (e.tokens[0].raw = t.raw + e.tokens[0].raw, e.tokens[0].text = t.raw + e.tokens[0].text, e.tokens[0].tokens.unshift(t)) : e.tokens.unshift({
|
|
425
|
-
type: "paragraph",
|
|
426
|
-
raw: t.raw,
|
|
427
|
-
text: t.raw,
|
|
428
|
-
tokens: [t]
|
|
429
|
-
}) : e.tokens.unshift(t);
|
|
430
|
-
}
|
|
431
|
-
} else e.task && (e.task = !1);
|
|
432
|
-
if (!i.loose) {
|
|
433
|
-
let t = e.tokens.filter((e) => e.type === "space");
|
|
434
|
-
i.loose = t.length > 0 && t.some((e) => this.rules.other.anyLine.test(e.raw));
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
if (i.loose) for (let e of i.items) {
|
|
438
|
-
e.loose = !0;
|
|
439
|
-
for (let t of e.tokens) t.type === "text" && (t.type = "paragraph");
|
|
440
|
-
}
|
|
441
|
-
return i;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
html(e) {
|
|
445
|
-
let t = this.rules.block.html.exec(e);
|
|
446
|
-
if (t) {
|
|
447
|
-
let e = Je(t[0]);
|
|
448
|
-
return {
|
|
449
|
-
type: "html",
|
|
450
|
-
block: !0,
|
|
451
|
-
raw: e,
|
|
452
|
-
pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
|
|
453
|
-
text: e
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
def(e) {
|
|
458
|
-
let t = this.rules.block.def.exec(e);
|
|
459
|
-
if (t) {
|
|
460
|
-
let e = t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
461
|
-
return {
|
|
462
|
-
type: "def",
|
|
463
|
-
tag: e,
|
|
464
|
-
raw: G(t[0], "\n"),
|
|
465
|
-
href: n,
|
|
466
|
-
title: r
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
table(e) {
|
|
471
|
-
var t;
|
|
472
|
-
let n = this.rules.block.table.exec(e);
|
|
473
|
-
if (!n || !this.rules.other.tableDelimiter.test(n[2])) return;
|
|
474
|
-
let r = qe(n[1]), i = n[2].replace(this.rules.other.tableAlignChars, "").split("|"), a = (t = n[3]) != null && t.trim() ? n[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], o = {
|
|
475
|
-
type: "table",
|
|
476
|
-
raw: G(n[0], "\n"),
|
|
477
|
-
header: [],
|
|
478
|
-
align: [],
|
|
479
|
-
rows: []
|
|
480
|
-
};
|
|
481
|
-
if (r.length === i.length) {
|
|
482
|
-
for (let e of i) this.rules.other.tableAlignRight.test(e) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(e) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(e) ? o.align.push("left") : o.align.push(null);
|
|
483
|
-
for (let e = 0; e < r.length; e++) o.header.push({
|
|
484
|
-
text: r[e],
|
|
485
|
-
tokens: this.lexer.inline(r[e]),
|
|
486
|
-
header: !0,
|
|
487
|
-
align: o.align[e]
|
|
488
|
-
});
|
|
489
|
-
for (let e of a) o.rows.push(qe(e, o.header.length).map((e, t) => ({
|
|
490
|
-
text: e,
|
|
491
|
-
tokens: this.lexer.inline(e),
|
|
492
|
-
header: !1,
|
|
493
|
-
align: o.align[t]
|
|
494
|
-
})));
|
|
495
|
-
return o;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
lheading(e) {
|
|
499
|
-
let t = this.rules.block.lheading.exec(e);
|
|
500
|
-
if (t) {
|
|
501
|
-
let e = t[1].trim();
|
|
502
|
-
return {
|
|
503
|
-
type: "heading",
|
|
504
|
-
raw: G(t[0], "\n"),
|
|
505
|
-
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
506
|
-
text: e,
|
|
507
|
-
tokens: this.lexer.inline(e)
|
|
508
|
-
};
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
paragraph(e) {
|
|
512
|
-
let t = this.rules.block.paragraph.exec(e);
|
|
513
|
-
if (t) {
|
|
514
|
-
let e = t[1].charAt(t[1].length - 1) === "\n" ? t[1].slice(0, -1) : t[1];
|
|
515
|
-
return {
|
|
516
|
-
type: "paragraph",
|
|
517
|
-
raw: t[0],
|
|
518
|
-
text: e,
|
|
519
|
-
tokens: this.lexer.inline(e)
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
text(e) {
|
|
524
|
-
let t = this.rules.block.text.exec(e);
|
|
525
|
-
if (t) return {
|
|
526
|
-
type: "text",
|
|
527
|
-
raw: t[0],
|
|
528
|
-
text: t[0],
|
|
529
|
-
tokens: this.lexer.inline(t[0])
|
|
530
|
-
};
|
|
531
|
-
}
|
|
532
|
-
escape(e) {
|
|
533
|
-
let t = this.rules.inline.escape.exec(e);
|
|
534
|
-
if (t) return {
|
|
535
|
-
type: "escape",
|
|
536
|
-
raw: t[0],
|
|
537
|
-
text: t[1]
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
tag(e) {
|
|
541
|
-
let t = this.rules.inline.tag.exec(e);
|
|
542
|
-
if (t) return !this.lexer.state.inLink && this.rules.other.startATag.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
|
|
543
|
-
type: "html",
|
|
544
|
-
raw: t[0],
|
|
545
|
-
inLink: this.lexer.state.inLink,
|
|
546
|
-
inRawBlock: this.lexer.state.inRawBlock,
|
|
547
|
-
block: !1,
|
|
548
|
-
text: t[0]
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
link(e) {
|
|
552
|
-
let t = this.rules.inline.link.exec(e);
|
|
553
|
-
if (t) {
|
|
554
|
-
let e = t[2].trim();
|
|
555
|
-
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(e)) {
|
|
556
|
-
if (!this.rules.other.endAngleBracket.test(e)) return;
|
|
557
|
-
let t = G(e.slice(0, -1), "\\");
|
|
558
|
-
if ((e.length - t.length) % 2 == 0) return;
|
|
559
|
-
} else {
|
|
560
|
-
let e = Ye(t[2], "()");
|
|
561
|
-
if (e === -2) return;
|
|
562
|
-
if (e > -1) {
|
|
563
|
-
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
564
|
-
t[2] = t[2].substring(0, e), t[0] = t[0].substring(0, n).trim(), t[3] = "";
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
let n = t[2], r = "";
|
|
568
|
-
if (this.options.pedantic) {
|
|
569
|
-
let e = this.rules.other.pedanticHrefTitle.exec(n);
|
|
570
|
-
e && (n = e[1], r = e[3]);
|
|
571
|
-
} else r = t[3] ? t[3].slice(1, -1) : "";
|
|
572
|
-
return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (n = this.options.pedantic && !this.rules.other.endAngleBracket.test(e) ? n.slice(1) : n.slice(1, -1)), Ze(t, {
|
|
573
|
-
href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
574
|
-
title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
|
|
575
|
-
}, t[0], this.lexer, this.rules);
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
reflink(e, t) {
|
|
579
|
-
let n;
|
|
580
|
-
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
581
|
-
let e = t[(n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " ").toLowerCase()];
|
|
582
|
-
if (!e) {
|
|
583
|
-
let e = n[0].charAt(0);
|
|
584
|
-
return {
|
|
585
|
-
type: "text",
|
|
586
|
-
raw: e,
|
|
587
|
-
text: e
|
|
588
|
-
};
|
|
589
|
-
}
|
|
590
|
-
return Ze(n, e, n[0], this.lexer, this.rules);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
emStrong(e, t, n = "") {
|
|
594
|
-
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
595
|
-
if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
596
|
-
let n = [...r[0]].length - 1, i, a, o = n, s = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
597
|
-
for (c.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = c.exec(t)) !== null;) {
|
|
598
|
-
if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i) continue;
|
|
599
|
-
if (a = [...i].length, r[3] || r[4]) {
|
|
600
|
-
o += a;
|
|
601
|
-
continue;
|
|
602
|
-
} else if ((r[5] || r[6]) && n % 3 && !((n + a) % 3)) {
|
|
603
|
-
s += a;
|
|
604
|
-
continue;
|
|
605
|
-
}
|
|
606
|
-
if (o -= a, o > 0) continue;
|
|
607
|
-
a = Math.min(a, a + o + s);
|
|
608
|
-
let t = [...r[0]][0].length, c = e.slice(0, n + r.index + t + a);
|
|
609
|
-
if (Math.min(n, a) % 2) {
|
|
610
|
-
let e = c.slice(1, -1);
|
|
611
|
-
return {
|
|
612
|
-
type: "em",
|
|
613
|
-
raw: c,
|
|
614
|
-
text: e,
|
|
615
|
-
tokens: this.lexer.inlineTokens(e)
|
|
616
|
-
};
|
|
617
|
-
}
|
|
618
|
-
let l = c.slice(2, -2);
|
|
619
|
-
return {
|
|
620
|
-
type: "strong",
|
|
621
|
-
raw: c,
|
|
622
|
-
text: l,
|
|
623
|
-
tokens: this.lexer.inlineTokens(l)
|
|
624
|
-
};
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
codespan(e) {
|
|
629
|
-
let t = this.rules.inline.code.exec(e);
|
|
630
|
-
if (t) {
|
|
631
|
-
let e = t[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(e), r = this.rules.other.startingSpaceChar.test(e) && this.rules.other.endingSpaceChar.test(e);
|
|
632
|
-
return n && r && (e = e.substring(1, e.length - 1)), {
|
|
633
|
-
type: "codespan",
|
|
634
|
-
raw: t[0],
|
|
635
|
-
text: e
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
br(e) {
|
|
640
|
-
let t = this.rules.inline.br.exec(e);
|
|
641
|
-
if (t) return {
|
|
642
|
-
type: "br",
|
|
643
|
-
raw: t[0]
|
|
644
|
-
};
|
|
645
|
-
}
|
|
646
|
-
del(e, t, n = "") {
|
|
647
|
-
let r = this.rules.inline.delLDelim.exec(e);
|
|
648
|
-
if (r && (!r[1] || !n || this.rules.inline.punctuation.exec(n))) {
|
|
649
|
-
let n = [...r[0]].length - 1, i, a, o = n, s = this.rules.inline.delRDelim;
|
|
650
|
-
for (s.lastIndex = 0, t = t.slice(-1 * e.length + n); (r = s.exec(t)) !== null;) {
|
|
651
|
-
if (i = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !i || (a = [...i].length, a !== n)) continue;
|
|
652
|
-
if (r[3] || r[4]) {
|
|
653
|
-
o += a;
|
|
654
|
-
continue;
|
|
655
|
-
}
|
|
656
|
-
if (o -= a, o > 0) continue;
|
|
657
|
-
a = Math.min(a, a + o);
|
|
658
|
-
let t = [...r[0]][0].length, s = e.slice(0, n + r.index + t + a), c = s.slice(n, -n);
|
|
659
|
-
return {
|
|
660
|
-
type: "del",
|
|
661
|
-
raw: s,
|
|
662
|
-
text: c,
|
|
663
|
-
tokens: this.lexer.inlineTokens(c)
|
|
664
|
-
};
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
autolink(e) {
|
|
669
|
-
let t = this.rules.inline.autolink.exec(e);
|
|
670
|
-
if (t) {
|
|
671
|
-
let e, n;
|
|
672
|
-
return t[2] === "@" ? (e = t[1], n = "mailto:" + e) : (e = t[1], n = e), {
|
|
673
|
-
type: "link",
|
|
674
|
-
raw: t[0],
|
|
675
|
-
text: e,
|
|
676
|
-
href: n,
|
|
677
|
-
tokens: [{
|
|
678
|
-
type: "text",
|
|
679
|
-
raw: e,
|
|
680
|
-
text: e
|
|
681
|
-
}]
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
url(e) {
|
|
686
|
-
let t;
|
|
687
|
-
if (t = this.rules.inline.url.exec(e)) {
|
|
688
|
-
let e, i;
|
|
689
|
-
if (t[2] === "@") e = t[0], i = "mailto:" + e;
|
|
690
|
-
else {
|
|
691
|
-
var n, r;
|
|
692
|
-
let a;
|
|
693
|
-
do
|
|
694
|
-
a = t[0], t[0] = (n = (r = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : r[0]) == null ? "" : n;
|
|
695
|
-
while (a !== t[0]);
|
|
696
|
-
e = t[0], i = t[1] === "www." ? "http://" + t[0] : t[0];
|
|
697
|
-
}
|
|
698
|
-
return {
|
|
699
|
-
type: "link",
|
|
700
|
-
raw: t[0],
|
|
701
|
-
text: e,
|
|
702
|
-
href: i,
|
|
703
|
-
tokens: [{
|
|
704
|
-
type: "text",
|
|
705
|
-
raw: e,
|
|
706
|
-
text: e
|
|
707
|
-
}]
|
|
708
|
-
};
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
inlineText(e) {
|
|
712
|
-
let t = this.rules.inline.text.exec(e);
|
|
713
|
-
if (t) {
|
|
714
|
-
let e = this.lexer.state.inRawBlock;
|
|
715
|
-
return {
|
|
716
|
-
type: "text",
|
|
717
|
-
raw: t[0],
|
|
718
|
-
text: t[0],
|
|
719
|
-
escaped: e
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
}, q = class e {
|
|
724
|
-
constructor(e) {
|
|
725
|
-
t(this, "tokens", void 0), t(this, "options", void 0), t(this, "state", void 0), t(this, "inlineQueue", void 0), t(this, "tokenizer", void 0), this.tokens = [], this.tokens.links = Object.create(null), this.options = e || _, this.options.tokenizer = this.options.tokenizer || new K(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
726
|
-
inLink: !1,
|
|
727
|
-
inRawBlock: !1,
|
|
728
|
-
top: !0
|
|
729
|
-
};
|
|
730
|
-
let n = {
|
|
731
|
-
other: x,
|
|
732
|
-
block: H.normal,
|
|
733
|
-
inline: U.normal
|
|
734
|
-
};
|
|
735
|
-
this.options.pedantic ? (n.block = H.pedantic, n.inline = U.pedantic) : this.options.gfm && (n.block = H.gfm, this.options.breaks ? n.inline = U.breaks : n.inline = U.gfm), this.tokenizer.rules = n;
|
|
736
|
-
}
|
|
737
|
-
static get rules() {
|
|
738
|
-
return {
|
|
739
|
-
block: H,
|
|
740
|
-
inline: U
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
static lex(t, n) {
|
|
744
|
-
return new e(n).lex(t);
|
|
745
|
-
}
|
|
746
|
-
static lexInline(t, n) {
|
|
747
|
-
return new e(n).inlineTokens(t);
|
|
748
|
-
}
|
|
749
|
-
lex(e) {
|
|
750
|
-
e = e.replace(x.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
751
|
-
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
752
|
-
let t = this.inlineQueue[e];
|
|
753
|
-
this.inlineTokens(t.src, t.tokens);
|
|
754
|
-
}
|
|
755
|
-
return this.inlineQueue = [], this.tokens;
|
|
756
|
-
}
|
|
757
|
-
blockTokens(e, t = [], n = !1) {
|
|
758
|
-
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, ""));
|
|
759
|
-
let r = Infinity;
|
|
760
|
-
for (; e;) {
|
|
761
|
-
var i, a;
|
|
762
|
-
if (e.length < r) r = e.length;
|
|
763
|
-
else {
|
|
764
|
-
this.infiniteLoopError(e.charCodeAt(0));
|
|
765
|
-
break;
|
|
766
|
-
}
|
|
767
|
-
let o;
|
|
768
|
-
if (!((i = this.options.extensions) == null || (i = i.block) == null) && i.some((n) => (o = n.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), !0) : !1)) continue;
|
|
769
|
-
if (o = this.tokenizer.space(e)) {
|
|
770
|
-
e = e.substring(o.raw.length);
|
|
771
|
-
let n = t.at(-1);
|
|
772
|
-
o.raw.length === 1 && n !== void 0 ? n.raw += "\n" : t.push(o);
|
|
773
|
-
continue;
|
|
774
|
-
}
|
|
775
|
-
if (o = this.tokenizer.code(e)) {
|
|
776
|
-
e = e.substring(o.raw.length);
|
|
777
|
-
let n = t.at(-1);
|
|
778
|
-
(n == null ? void 0 : n.type) === "paragraph" || (n == null ? void 0 : n.type) === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + o.raw, n.text += "\n" + o.text, this.inlineQueue.at(-1).src = n.text) : t.push(o);
|
|
779
|
-
continue;
|
|
780
|
-
}
|
|
781
|
-
if (o = this.tokenizer.fences(e)) {
|
|
782
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
783
|
-
continue;
|
|
784
|
-
}
|
|
785
|
-
if (o = this.tokenizer.heading(e)) {
|
|
786
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
787
|
-
continue;
|
|
788
|
-
}
|
|
789
|
-
if (o = this.tokenizer.hr(e)) {
|
|
790
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
791
|
-
continue;
|
|
792
|
-
}
|
|
793
|
-
if (o = this.tokenizer.blockquote(e)) {
|
|
794
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
795
|
-
continue;
|
|
796
|
-
}
|
|
797
|
-
if (o = this.tokenizer.list(e)) {
|
|
798
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
799
|
-
continue;
|
|
800
|
-
}
|
|
801
|
-
if (o = this.tokenizer.html(e)) {
|
|
802
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
803
|
-
continue;
|
|
804
|
-
}
|
|
805
|
-
if (o = this.tokenizer.def(e)) {
|
|
806
|
-
e = e.substring(o.raw.length);
|
|
807
|
-
let n = t.at(-1);
|
|
808
|
-
(n == null ? void 0 : n.type) === "paragraph" || (n == null ? void 0 : n.type) === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + o.raw, n.text += "\n" + o.raw, this.inlineQueue.at(-1).src = n.text) : this.tokens.links[o.tag] || (this.tokens.links[o.tag] = {
|
|
809
|
-
href: o.href,
|
|
810
|
-
title: o.title
|
|
811
|
-
}, t.push(o));
|
|
812
|
-
continue;
|
|
813
|
-
}
|
|
814
|
-
if (o = this.tokenizer.table(e)) {
|
|
815
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
816
|
-
continue;
|
|
817
|
-
}
|
|
818
|
-
if (o = this.tokenizer.lheading(e)) {
|
|
819
|
-
e = e.substring(o.raw.length), t.push(o);
|
|
820
|
-
continue;
|
|
821
|
-
}
|
|
822
|
-
let s = e;
|
|
823
|
-
if ((a = this.options.extensions) != null && a.startBlock) {
|
|
824
|
-
let t = Infinity, n = e.slice(1), r;
|
|
825
|
-
this.options.extensions.startBlock.forEach((e) => {
|
|
826
|
-
r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
|
|
827
|
-
}), t < Infinity && t >= 0 && (s = e.substring(0, t + 1));
|
|
828
|
-
}
|
|
829
|
-
if (this.state.top && (o = this.tokenizer.paragraph(s))) {
|
|
830
|
-
let r = t.at(-1);
|
|
831
|
-
n && (r == null ? void 0 : r.type) === "paragraph" ? (r.raw += (r.raw.endsWith("\n") ? "" : "\n") + o.raw, r.text += "\n" + o.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = r.text) : t.push(o), n = s.length !== e.length, e = e.substring(o.raw.length);
|
|
832
|
-
continue;
|
|
833
|
-
}
|
|
834
|
-
if (o = this.tokenizer.text(e)) {
|
|
835
|
-
e = e.substring(o.raw.length);
|
|
836
|
-
let n = t.at(-1);
|
|
837
|
-
(n == null ? void 0 : n.type) === "text" ? (n.raw += (n.raw.endsWith("\n") ? "" : "\n") + o.raw, n.text += "\n" + o.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = n.text) : t.push(o);
|
|
838
|
-
continue;
|
|
839
|
-
}
|
|
840
|
-
if (e) {
|
|
841
|
-
this.infiniteLoopError(e.charCodeAt(0));
|
|
842
|
-
break;
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
return this.state.top = !0, t;
|
|
846
|
-
}
|
|
847
|
-
inline(e, t = []) {
|
|
848
|
-
return this.inlineQueue.push({
|
|
849
|
-
src: e,
|
|
850
|
-
tokens: t
|
|
851
|
-
}), t;
|
|
852
|
-
}
|
|
853
|
-
inlineTokens(e, t = []) {
|
|
854
|
-
var n, r;
|
|
855
|
-
this.tokenizer.lexer = this;
|
|
856
|
-
let i = e, a = null;
|
|
857
|
-
if (this.tokens.links) {
|
|
858
|
-
let e = Object.keys(this.tokens.links);
|
|
859
|
-
if (e.length > 0) for (; (a = this.tokenizer.rules.inline.reflinkSearch.exec(i)) !== null;) e.includes(a[0].slice(a[0].lastIndexOf("[") + 1, -1)) && (i = i.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
860
|
-
}
|
|
861
|
-
for (; (a = this.tokenizer.rules.inline.anyPunctuation.exec(i)) !== null;) i = i.slice(0, a.index) + "++" + i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
862
|
-
let o;
|
|
863
|
-
for (; (a = this.tokenizer.rules.inline.blockSkip.exec(i)) !== null;) o = a[2] ? a[2].length : 0, i = i.slice(0, a.index + o) + "[" + "a".repeat(a[0].length - o - 2) + "]" + i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
864
|
-
i = (n = (r = this.options.hooks) == null || (r = r.emStrongMask) == null ? void 0 : r.call({ lexer: this }, i)) == null ? i : n;
|
|
865
|
-
let s = !1, c = "", l = Infinity;
|
|
866
|
-
for (; e;) {
|
|
867
|
-
var u, d;
|
|
868
|
-
if (e.length < l) l = e.length;
|
|
869
|
-
else {
|
|
870
|
-
this.infiniteLoopError(e.charCodeAt(0));
|
|
871
|
-
break;
|
|
872
|
-
}
|
|
873
|
-
s || (c = ""), s = !1;
|
|
874
|
-
let n;
|
|
875
|
-
if (!((u = this.options.extensions) == null || (u = u.inline) == null) && u.some((r) => (n = r.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1)) continue;
|
|
876
|
-
if (n = this.tokenizer.escape(e)) {
|
|
877
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
878
|
-
continue;
|
|
879
|
-
}
|
|
880
|
-
if (n = this.tokenizer.tag(e)) {
|
|
881
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
882
|
-
continue;
|
|
883
|
-
}
|
|
884
|
-
if (n = this.tokenizer.link(e)) {
|
|
885
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
886
|
-
continue;
|
|
887
|
-
}
|
|
888
|
-
if (n = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
889
|
-
e = e.substring(n.raw.length);
|
|
890
|
-
let r = t.at(-1);
|
|
891
|
-
n.type === "text" && (r == null ? void 0 : r.type) === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
|
|
892
|
-
continue;
|
|
893
|
-
}
|
|
894
|
-
if (n = this.tokenizer.emStrong(e, i, c)) {
|
|
895
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
896
|
-
continue;
|
|
897
|
-
}
|
|
898
|
-
if (n = this.tokenizer.codespan(e)) {
|
|
899
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
900
|
-
continue;
|
|
901
|
-
}
|
|
902
|
-
if (n = this.tokenizer.br(e)) {
|
|
903
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
904
|
-
continue;
|
|
905
|
-
}
|
|
906
|
-
if (n = this.tokenizer.del(e, i, c)) {
|
|
907
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
908
|
-
continue;
|
|
909
|
-
}
|
|
910
|
-
if (n = this.tokenizer.autolink(e)) {
|
|
911
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
912
|
-
continue;
|
|
913
|
-
}
|
|
914
|
-
if (!this.state.inLink && (n = this.tokenizer.url(e))) {
|
|
915
|
-
e = e.substring(n.raw.length), t.push(n);
|
|
916
|
-
continue;
|
|
917
|
-
}
|
|
918
|
-
let r = e;
|
|
919
|
-
if ((d = this.options.extensions) != null && d.startInline) {
|
|
920
|
-
let t = Infinity, n = e.slice(1), i;
|
|
921
|
-
this.options.extensions.startInline.forEach((e) => {
|
|
922
|
-
i = e.call({ lexer: this }, n), typeof i == "number" && i >= 0 && (t = Math.min(t, i));
|
|
923
|
-
}), t < Infinity && t >= 0 && (r = e.substring(0, t + 1));
|
|
924
|
-
}
|
|
925
|
-
if (n = this.tokenizer.inlineText(r)) {
|
|
926
|
-
e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (c = n.raw.slice(-1)), s = !0;
|
|
927
|
-
let r = t.at(-1);
|
|
928
|
-
(r == null ? void 0 : r.type) === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
|
|
929
|
-
continue;
|
|
930
|
-
}
|
|
931
|
-
if (e) {
|
|
932
|
-
this.infiniteLoopError(e.charCodeAt(0));
|
|
933
|
-
break;
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
return t;
|
|
937
|
-
}
|
|
938
|
-
infiniteLoopError(e) {
|
|
939
|
-
let t = "Infinite loop on byte: " + e;
|
|
940
|
-
if (this.options.silent) console.error(t);
|
|
941
|
-
else throw Error(t);
|
|
942
|
-
}
|
|
943
|
-
}, J = class {
|
|
944
|
-
constructor(e) {
|
|
945
|
-
t(this, "options", void 0), t(this, "parser", void 0), this.options = e || _;
|
|
946
|
-
}
|
|
947
|
-
space(e) {
|
|
948
|
-
return "";
|
|
949
|
-
}
|
|
950
|
-
code({ text: e, lang: t, escaped: n }) {
|
|
951
|
-
var r;
|
|
952
|
-
let i = (r = (t || "").match(x.notSpaceStart)) == null ? void 0 : r[0], a = e.replace(x.endingNewline, "") + "\n";
|
|
953
|
-
return i ? "<pre><code class=\"language-" + W(i) + "\">" + (n ? a : W(a, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? a : W(a, !0)) + "</code></pre>\n";
|
|
954
|
-
}
|
|
955
|
-
blockquote({ tokens: e }) {
|
|
956
|
-
return `<blockquote>
|
|
957
|
-
${this.parser.parse(e)}</blockquote>
|
|
958
|
-
`;
|
|
959
|
-
}
|
|
960
|
-
html({ text: e }) {
|
|
961
|
-
return e;
|
|
962
|
-
}
|
|
963
|
-
def(e) {
|
|
964
|
-
return "";
|
|
965
|
-
}
|
|
966
|
-
heading({ tokens: e, depth: t }) {
|
|
967
|
-
return `<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
968
|
-
`;
|
|
969
|
-
}
|
|
970
|
-
hr(e) {
|
|
971
|
-
return "<hr>\n";
|
|
972
|
-
}
|
|
973
|
-
list(e) {
|
|
974
|
-
let t = e.ordered, n = e.start, r = "";
|
|
975
|
-
for (let t = 0; t < e.items.length; t++) {
|
|
976
|
-
let n = e.items[t];
|
|
977
|
-
r += this.listitem(n);
|
|
978
|
-
}
|
|
979
|
-
let i = t ? "ol" : "ul", a = t && n !== 1 ? " start=\"" + n + "\"" : "";
|
|
980
|
-
return "<" + i + a + ">\n" + r + "</" + i + ">\n";
|
|
981
|
-
}
|
|
982
|
-
listitem(e) {
|
|
983
|
-
return `<li>${this.parser.parse(e.tokens)}</li>
|
|
984
|
-
`;
|
|
985
|
-
}
|
|
986
|
-
checkbox({ checked: e }) {
|
|
987
|
-
return "<input " + (e ? "checked=\"\" " : "") + "disabled=\"\" type=\"checkbox\"> ";
|
|
988
|
-
}
|
|
989
|
-
paragraph({ tokens: e }) {
|
|
990
|
-
return `<p>${this.parser.parseInline(e)}</p>
|
|
991
|
-
`;
|
|
992
|
-
}
|
|
993
|
-
table(e) {
|
|
994
|
-
let t = "", n = "";
|
|
995
|
-
for (let t = 0; t < e.header.length; t++) n += this.tablecell(e.header[t]);
|
|
996
|
-
t += this.tablerow({ text: n });
|
|
997
|
-
let r = "";
|
|
998
|
-
for (let t = 0; t < e.rows.length; t++) {
|
|
999
|
-
let i = e.rows[t];
|
|
1000
|
-
n = "";
|
|
1001
|
-
for (let e = 0; e < i.length; e++) n += this.tablecell(i[e]);
|
|
1002
|
-
r += this.tablerow({ text: n });
|
|
1003
|
-
}
|
|
1004
|
-
return r && (r = `<tbody>${r}</tbody>`), "<table>\n<thead>\n" + t + "</thead>\n" + r + "</table>\n";
|
|
1005
|
-
}
|
|
1006
|
-
tablerow({ text: e }) {
|
|
1007
|
-
return `<tr>
|
|
1008
|
-
${e}</tr>
|
|
1009
|
-
`;
|
|
1010
|
-
}
|
|
1011
|
-
tablecell(e) {
|
|
1012
|
-
let t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
|
|
1013
|
-
return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
|
|
1014
|
-
`;
|
|
1015
|
-
}
|
|
1016
|
-
strong({ tokens: e }) {
|
|
1017
|
-
return `<strong>${this.parser.parseInline(e)}</strong>`;
|
|
1018
|
-
}
|
|
1019
|
-
em({ tokens: e }) {
|
|
1020
|
-
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
1021
|
-
}
|
|
1022
|
-
codespan({ text: e }) {
|
|
1023
|
-
return `<code>${W(e, !0)}</code>`;
|
|
1024
|
-
}
|
|
1025
|
-
br(e) {
|
|
1026
|
-
return "<br>";
|
|
1027
|
-
}
|
|
1028
|
-
del({ tokens: e }) {
|
|
1029
|
-
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
1030
|
-
}
|
|
1031
|
-
link({ href: e, title: t, tokens: n }) {
|
|
1032
|
-
let r = this.parser.parseInline(n), i = Ke(e);
|
|
1033
|
-
if (i === null) return r;
|
|
1034
|
-
e = i;
|
|
1035
|
-
let a = "<a href=\"" + e + "\"";
|
|
1036
|
-
return t && (a += " title=\"" + W(t) + "\""), a += ">" + r + "</a>", a;
|
|
1037
|
-
}
|
|
1038
|
-
image({ href: e, title: t, text: n, tokens: r }) {
|
|
1039
|
-
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
1040
|
-
let i = Ke(e);
|
|
1041
|
-
if (i === null) return W(n);
|
|
1042
|
-
e = i;
|
|
1043
|
-
let a = `<img src="${e}" alt="${W(n)}"`;
|
|
1044
|
-
return t && (a += ` title="${W(t)}"`), a += ">", a;
|
|
1045
|
-
}
|
|
1046
|
-
text(e) {
|
|
1047
|
-
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : W(e.text);
|
|
1048
|
-
}
|
|
1049
|
-
}, Y = class {
|
|
1050
|
-
strong({ text: e }) {
|
|
1051
|
-
return e;
|
|
1052
|
-
}
|
|
1053
|
-
em({ text: e }) {
|
|
1054
|
-
return e;
|
|
1055
|
-
}
|
|
1056
|
-
codespan({ text: e }) {
|
|
1057
|
-
return e;
|
|
1058
|
-
}
|
|
1059
|
-
del({ text: e }) {
|
|
1060
|
-
return e;
|
|
1061
|
-
}
|
|
1062
|
-
html({ text: e }) {
|
|
1063
|
-
return e;
|
|
1064
|
-
}
|
|
1065
|
-
text({ text: e }) {
|
|
1066
|
-
return e;
|
|
1067
|
-
}
|
|
1068
|
-
link({ text: e }) {
|
|
1069
|
-
return "" + e;
|
|
1070
|
-
}
|
|
1071
|
-
image({ text: e }) {
|
|
1072
|
-
return "" + e;
|
|
1073
|
-
}
|
|
1074
|
-
br() {
|
|
1075
|
-
return "";
|
|
1076
|
-
}
|
|
1077
|
-
checkbox({ raw: e }) {
|
|
1078
|
-
return e;
|
|
1079
|
-
}
|
|
1080
|
-
}, X = class e {
|
|
1081
|
-
constructor(e) {
|
|
1082
|
-
t(this, "options", void 0), t(this, "renderer", void 0), t(this, "textRenderer", void 0), this.options = e || _, this.options.renderer = this.options.renderer || new J(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Y();
|
|
1083
|
-
}
|
|
1084
|
-
static parse(t, n) {
|
|
1085
|
-
return new e(n).parse(t);
|
|
1086
|
-
}
|
|
1087
|
-
static parseInline(t, n) {
|
|
1088
|
-
return new e(n).parseInline(t);
|
|
1089
|
-
}
|
|
1090
|
-
parse(e) {
|
|
1091
|
-
this.renderer.parser = this;
|
|
1092
|
-
let t = "";
|
|
1093
|
-
for (let r = 0; r < e.length; r++) {
|
|
1094
|
-
var n;
|
|
1095
|
-
let i = e[r];
|
|
1096
|
-
if (!((n = this.options.extensions) == null || (n = n.renderers) == null) && n[i.type]) {
|
|
1097
|
-
let e = i, n = this.options.extensions.renderers[e.type].call({ parser: this }, e);
|
|
1098
|
-
if (n !== !1 || ![
|
|
1099
|
-
"space",
|
|
1100
|
-
"hr",
|
|
1101
|
-
"heading",
|
|
1102
|
-
"code",
|
|
1103
|
-
"table",
|
|
1104
|
-
"blockquote",
|
|
1105
|
-
"list",
|
|
1106
|
-
"html",
|
|
1107
|
-
"def",
|
|
1108
|
-
"paragraph",
|
|
1109
|
-
"text"
|
|
1110
|
-
].includes(e.type)) {
|
|
1111
|
-
t += n || "";
|
|
1112
|
-
continue;
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
let a = i;
|
|
1116
|
-
switch (a.type) {
|
|
1117
|
-
case "space":
|
|
1118
|
-
t += this.renderer.space(a);
|
|
1119
|
-
break;
|
|
1120
|
-
case "hr":
|
|
1121
|
-
t += this.renderer.hr(a);
|
|
1122
|
-
break;
|
|
1123
|
-
case "heading":
|
|
1124
|
-
t += this.renderer.heading(a);
|
|
1125
|
-
break;
|
|
1126
|
-
case "code":
|
|
1127
|
-
t += this.renderer.code(a);
|
|
1128
|
-
break;
|
|
1129
|
-
case "table":
|
|
1130
|
-
t += this.renderer.table(a);
|
|
1131
|
-
break;
|
|
1132
|
-
case "blockquote":
|
|
1133
|
-
t += this.renderer.blockquote(a);
|
|
1134
|
-
break;
|
|
1135
|
-
case "list":
|
|
1136
|
-
t += this.renderer.list(a);
|
|
1137
|
-
break;
|
|
1138
|
-
case "checkbox":
|
|
1139
|
-
t += this.renderer.checkbox(a);
|
|
1140
|
-
break;
|
|
1141
|
-
case "html":
|
|
1142
|
-
t += this.renderer.html(a);
|
|
1143
|
-
break;
|
|
1144
|
-
case "def":
|
|
1145
|
-
t += this.renderer.def(a);
|
|
1146
|
-
break;
|
|
1147
|
-
case "paragraph":
|
|
1148
|
-
t += this.renderer.paragraph(a);
|
|
1149
|
-
break;
|
|
1150
|
-
case "text":
|
|
1151
|
-
t += this.renderer.text(a);
|
|
1152
|
-
break;
|
|
1153
|
-
default: {
|
|
1154
|
-
let e = "Token with \"" + a.type + "\" type was not found.";
|
|
1155
|
-
if (this.options.silent) return console.error(e), "";
|
|
1156
|
-
throw Error(e);
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
return t;
|
|
1161
|
-
}
|
|
1162
|
-
parseInline(e, t = this.renderer) {
|
|
1163
|
-
this.renderer.parser = this;
|
|
1164
|
-
let n = "";
|
|
1165
|
-
for (let i = 0; i < e.length; i++) {
|
|
1166
|
-
var r;
|
|
1167
|
-
let a = e[i];
|
|
1168
|
-
if (!((r = this.options.extensions) == null || (r = r.renderers) == null) && r[a.type]) {
|
|
1169
|
-
let e = this.options.extensions.renderers[a.type].call({ parser: this }, a);
|
|
1170
|
-
if (e !== !1 || ![
|
|
1171
|
-
"escape",
|
|
1172
|
-
"html",
|
|
1173
|
-
"link",
|
|
1174
|
-
"image",
|
|
1175
|
-
"strong",
|
|
1176
|
-
"em",
|
|
1177
|
-
"codespan",
|
|
1178
|
-
"br",
|
|
1179
|
-
"del",
|
|
1180
|
-
"text"
|
|
1181
|
-
].includes(a.type)) {
|
|
1182
|
-
n += e || "";
|
|
1183
|
-
continue;
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
let o = a;
|
|
1187
|
-
switch (o.type) {
|
|
1188
|
-
case "escape":
|
|
1189
|
-
n += t.text(o);
|
|
1190
|
-
break;
|
|
1191
|
-
case "html":
|
|
1192
|
-
n += t.html(o);
|
|
1193
|
-
break;
|
|
1194
|
-
case "link":
|
|
1195
|
-
n += t.link(o);
|
|
1196
|
-
break;
|
|
1197
|
-
case "image":
|
|
1198
|
-
n += t.image(o);
|
|
1199
|
-
break;
|
|
1200
|
-
case "checkbox":
|
|
1201
|
-
n += t.checkbox(o);
|
|
1202
|
-
break;
|
|
1203
|
-
case "strong":
|
|
1204
|
-
n += t.strong(o);
|
|
1205
|
-
break;
|
|
1206
|
-
case "em":
|
|
1207
|
-
n += t.em(o);
|
|
1208
|
-
break;
|
|
1209
|
-
case "codespan":
|
|
1210
|
-
n += t.codespan(o);
|
|
1211
|
-
break;
|
|
1212
|
-
case "br":
|
|
1213
|
-
n += t.br(o);
|
|
1214
|
-
break;
|
|
1215
|
-
case "del":
|
|
1216
|
-
n += t.del(o);
|
|
1217
|
-
break;
|
|
1218
|
-
case "text":
|
|
1219
|
-
n += t.text(o);
|
|
1220
|
-
break;
|
|
1221
|
-
default: {
|
|
1222
|
-
let e = "Token with \"" + o.type + "\" type was not found.";
|
|
1223
|
-
if (this.options.silent) return console.error(e), "";
|
|
1224
|
-
throw Error(e);
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
|
-
return n;
|
|
1229
|
-
}
|
|
1230
|
-
}, Z = (h = class {
|
|
1231
|
-
constructor(e) {
|
|
1232
|
-
t(this, "options", void 0), t(this, "block", void 0), this.options = e || _;
|
|
1233
|
-
}
|
|
1234
|
-
preprocess(e) {
|
|
1235
|
-
return e;
|
|
1236
|
-
}
|
|
1237
|
-
postprocess(e) {
|
|
1238
|
-
return e;
|
|
1239
|
-
}
|
|
1240
|
-
processAllTokens(e) {
|
|
1241
|
-
return e;
|
|
1242
|
-
}
|
|
1243
|
-
emStrongMask(e) {
|
|
1244
|
-
return e;
|
|
1245
|
-
}
|
|
1246
|
-
provideLexer(e = this.block) {
|
|
1247
|
-
return e ? q.lex : q.lexInline;
|
|
1248
|
-
}
|
|
1249
|
-
provideParser(e = this.block) {
|
|
1250
|
-
return e ? X.parse : X.parseInline;
|
|
1251
|
-
}
|
|
1252
|
-
}, t(h, "passThroughHooks", new Set([
|
|
1253
|
-
"preprocess",
|
|
1254
|
-
"postprocess",
|
|
1255
|
-
"processAllTokens",
|
|
1256
|
-
"emStrongMask"
|
|
1257
|
-
])), t(h, "passThroughHooksRespectAsync", new Set([
|
|
1258
|
-
"preprocess",
|
|
1259
|
-
"postprocess",
|
|
1260
|
-
"processAllTokens"
|
|
1261
|
-
])), h), Q = new class {
|
|
1262
|
-
constructor(...e) {
|
|
1263
|
-
t(this, "defaults", g()), t(this, "options", this.setOptions), t(this, "parse", this.parseMarkdown(!0)), t(this, "parseInline", this.parseMarkdown(!1)), t(this, "Parser", X), t(this, "Renderer", J), t(this, "TextRenderer", Y), t(this, "Lexer", q), t(this, "Tokenizer", K), t(this, "Hooks", Z), this.use(...e);
|
|
1264
|
-
}
|
|
1265
|
-
walkTokens(e, t) {
|
|
1266
|
-
let n = [];
|
|
1267
|
-
for (let i of e) switch (n = n.concat(t.call(this, i)), i.type) {
|
|
1268
|
-
case "table": {
|
|
1269
|
-
let e = i;
|
|
1270
|
-
for (let r of e.header) n = n.concat(this.walkTokens(r.tokens, t));
|
|
1271
|
-
for (let r of e.rows) for (let e of r) n = n.concat(this.walkTokens(e.tokens, t));
|
|
1272
|
-
break;
|
|
1273
|
-
}
|
|
1274
|
-
case "list": {
|
|
1275
|
-
let e = i;
|
|
1276
|
-
n = n.concat(this.walkTokens(e.items, t));
|
|
1277
|
-
break;
|
|
1278
|
-
}
|
|
1279
|
-
default: {
|
|
1280
|
-
var r;
|
|
1281
|
-
let e = i;
|
|
1282
|
-
!((r = this.defaults.extensions) == null || (r = r.childTokens) == null) && r[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
|
|
1283
|
-
let i = e[r].flat(Infinity);
|
|
1284
|
-
n = n.concat(this.walkTokens(i, t));
|
|
1285
|
-
}) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
return n;
|
|
1289
|
-
}
|
|
1290
|
-
use(...e) {
|
|
1291
|
-
let t = this.defaults.extensions || {
|
|
1292
|
-
renderers: {},
|
|
1293
|
-
childTokens: {}
|
|
1294
|
-
};
|
|
1295
|
-
return e.forEach((e) => {
|
|
1296
|
-
let n = r({}, e);
|
|
1297
|
-
if (n.async = this.defaults.async || n.async || !1, e.extensions && (e.extensions.forEach((e) => {
|
|
1298
|
-
if (!e.name) throw Error("extension name required");
|
|
1299
|
-
if ("renderer" in e) {
|
|
1300
|
-
let n = t.renderers[e.name];
|
|
1301
|
-
n ? t.renderers[e.name] = function(...t) {
|
|
1302
|
-
let r = e.renderer.apply(this, t);
|
|
1303
|
-
return r === !1 && (r = n.apply(this, t)), r;
|
|
1304
|
-
} : t.renderers[e.name] = e.renderer;
|
|
1305
|
-
}
|
|
1306
|
-
if ("tokenizer" in e) {
|
|
1307
|
-
if (!e.level || e.level !== "block" && e.level !== "inline") throw Error("extension level must be 'block' or 'inline'");
|
|
1308
|
-
let n = t[e.level];
|
|
1309
|
-
n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && (e.level === "block" ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : e.level === "inline" && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]));
|
|
1310
|
-
}
|
|
1311
|
-
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
1312
|
-
}), n.extensions = t), e.renderer) {
|
|
1313
|
-
let t = this.defaults.renderer || new J(this.defaults);
|
|
1314
|
-
for (let n in e.renderer) {
|
|
1315
|
-
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
1316
|
-
if (["options", "parser"].includes(n)) continue;
|
|
1317
|
-
let r = n, i = e.renderer[r], a = t[r];
|
|
1318
|
-
t[r] = (...e) => {
|
|
1319
|
-
let n = i.apply(t, e);
|
|
1320
|
-
return n === !1 && (n = a.apply(t, e)), n || "";
|
|
1321
|
-
};
|
|
1322
|
-
}
|
|
1323
|
-
n.renderer = t;
|
|
1324
|
-
}
|
|
1325
|
-
if (e.tokenizer) {
|
|
1326
|
-
let t = this.defaults.tokenizer || new K(this.defaults);
|
|
1327
|
-
for (let n in e.tokenizer) {
|
|
1328
|
-
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
1329
|
-
if ([
|
|
1330
|
-
"options",
|
|
1331
|
-
"rules",
|
|
1332
|
-
"lexer"
|
|
1333
|
-
].includes(n)) continue;
|
|
1334
|
-
let r = n, i = e.tokenizer[r], a = t[r];
|
|
1335
|
-
t[r] = (...e) => {
|
|
1336
|
-
let n = i.apply(t, e);
|
|
1337
|
-
return n === !1 && (n = a.apply(t, e)), n;
|
|
1338
|
-
};
|
|
1339
|
-
}
|
|
1340
|
-
n.tokenizer = t;
|
|
1341
|
-
}
|
|
1342
|
-
if (e.hooks) {
|
|
1343
|
-
let t = this.defaults.hooks || new Z();
|
|
1344
|
-
for (let n in e.hooks) {
|
|
1345
|
-
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
1346
|
-
if (["options", "block"].includes(n)) continue;
|
|
1347
|
-
let r = n, i = e.hooks[r], o = t[r];
|
|
1348
|
-
Z.passThroughHooks.has(n) ? t[r] = (e) => {
|
|
1349
|
-
if (this.defaults.async && Z.passThroughHooksRespectAsync.has(n)) return a(function* () {
|
|
1350
|
-
let n = yield i.call(t, e);
|
|
1351
|
-
return o.call(t, n);
|
|
1352
|
-
})();
|
|
1353
|
-
let r = i.call(t, e);
|
|
1354
|
-
return o.call(t, r);
|
|
1355
|
-
} : t[r] = (...e) => {
|
|
1356
|
-
if (this.defaults.async) return a(function* () {
|
|
1357
|
-
let n = yield i.apply(t, e);
|
|
1358
|
-
return n === !1 && (n = yield o.apply(t, e)), n;
|
|
1359
|
-
})();
|
|
1360
|
-
let n = i.apply(t, e);
|
|
1361
|
-
return n === !1 && (n = o.apply(t, e)), n;
|
|
1362
|
-
};
|
|
1363
|
-
}
|
|
1364
|
-
n.hooks = t;
|
|
1365
|
-
}
|
|
1366
|
-
if (e.walkTokens) {
|
|
1367
|
-
let t = this.defaults.walkTokens, r = e.walkTokens;
|
|
1368
|
-
n.walkTokens = function(e) {
|
|
1369
|
-
let n = [];
|
|
1370
|
-
return n.push(r.call(this, e)), t && (n = n.concat(t.call(this, e))), n;
|
|
1371
|
-
};
|
|
1372
|
-
}
|
|
1373
|
-
this.defaults = r(r({}, this.defaults), n);
|
|
1374
|
-
}), this;
|
|
1375
|
-
}
|
|
1376
|
-
setOptions(e) {
|
|
1377
|
-
return this.defaults = r(r({}, this.defaults), e), this;
|
|
1378
|
-
}
|
|
1379
|
-
lexer(e, t) {
|
|
1380
|
-
return q.lex(e, t == null ? this.defaults : t);
|
|
1381
|
-
}
|
|
1382
|
-
parser(e, t) {
|
|
1383
|
-
return X.parse(e, t == null ? this.defaults : t);
|
|
1384
|
-
}
|
|
1385
|
-
parseMarkdown(e) {
|
|
1386
|
-
var t = this;
|
|
1387
|
-
return (n, i) => {
|
|
1388
|
-
let o = r({}, i), s = r(r({}, this.defaults), o), c = this.onError(!!s.silent, !!s.async);
|
|
1389
|
-
if (this.defaults.async === !0 && o.async === !1) return c(/* @__PURE__ */ Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
1390
|
-
if (typeof n > "u" || n === null) return c(/* @__PURE__ */ Error("marked(): input parameter is undefined or null"));
|
|
1391
|
-
if (typeof n != "string") return c(/* @__PURE__ */ Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
1392
|
-
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return a(function* () {
|
|
1393
|
-
let r = s.hooks ? yield s.hooks.preprocess(n) : n, i = yield (s.hooks ? yield s.hooks.provideLexer(e) : e ? q.lex : q.lexInline)(r, s), a = s.hooks ? yield s.hooks.processAllTokens(i) : i;
|
|
1394
|
-
s.walkTokens && (yield Promise.all(t.walkTokens(a, s.walkTokens)));
|
|
1395
|
-
let o = yield (s.hooks ? yield s.hooks.provideParser(e) : e ? X.parse : X.parseInline)(a, s);
|
|
1396
|
-
return s.hooks ? yield s.hooks.postprocess(o) : o;
|
|
1397
|
-
})().catch(c);
|
|
1398
|
-
try {
|
|
1399
|
-
s.hooks && (n = s.hooks.preprocess(n));
|
|
1400
|
-
let t = (s.hooks ? s.hooks.provideLexer(e) : e ? q.lex : q.lexInline)(n, s);
|
|
1401
|
-
s.hooks && (t = s.hooks.processAllTokens(t)), s.walkTokens && this.walkTokens(t, s.walkTokens);
|
|
1402
|
-
let r = (s.hooks ? s.hooks.provideParser(e) : e ? X.parse : X.parseInline)(t, s);
|
|
1403
|
-
return s.hooks && (r = s.hooks.postprocess(r)), r;
|
|
1404
|
-
} catch (e) {
|
|
1405
|
-
return c(e);
|
|
1406
|
-
}
|
|
1407
|
-
};
|
|
1408
|
-
}
|
|
1409
|
-
onError(e, t) {
|
|
1410
|
-
return (n) => {
|
|
1411
|
-
if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) {
|
|
1412
|
-
let e = "<p>An error occurred:</p><pre>" + W(n.message + "", !0) + "</pre>";
|
|
1413
|
-
return t ? Promise.resolve(e) : e;
|
|
1414
|
-
}
|
|
1415
|
-
if (t) return Promise.reject(n);
|
|
1416
|
-
throw n;
|
|
1417
|
-
};
|
|
1418
|
-
}
|
|
1419
|
-
}();
|
|
1420
|
-
function $(e, t) {
|
|
1421
|
-
return Q.parse(e, t);
|
|
1422
|
-
}
|
|
1423
|
-
$.options = $.setOptions = function(e) {
|
|
1424
|
-
return Q.setOptions(e), $.defaults = Q.defaults, ae($.defaults), $;
|
|
1425
|
-
}, $.getDefaults = g, $.defaults = _, $.use = function(...e) {
|
|
1426
|
-
return Q.use(...e), $.defaults = Q.defaults, ae($.defaults), $;
|
|
1427
|
-
}, $.walkTokens = function(e, t) {
|
|
1428
|
-
return Q.walkTokens(e, t);
|
|
1429
|
-
}, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = J, $.TextRenderer = Y, $.Lexer = q, $.lexer = q.lex, $.Tokenizer = K, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.use, $.walkTokens, $.parseInline, X.parse, q.lex;
|
|
1430
|
-
//#endregion
|
|
1431
|
-
//#region src/package/vendors/md/MarkdownViewer.vue?vue&type=script&setup=true&lang.ts
|
|
1432
|
-
var $e = ["innerHTML"], et = /*#__PURE__*/ l(/* @__PURE__ */ p({
|
|
1433
|
-
__name: "MarkdownViewer",
|
|
1434
|
-
props: { data: {} },
|
|
1435
|
-
setup(e) {
|
|
1436
|
-
let t = e, n = re(null), r = re(1), i = c(), a = u(() => $(t.data)), l = u(() => ({
|
|
1437
|
-
"--markdown-max-width": `${980 * r.value}px`,
|
|
1438
|
-
"--markdown-padding": `${45 * r.value}px`,
|
|
1439
|
-
"--markdown-font-size": `${16 * r.value}px`
|
|
1440
|
-
})), p = (e) => Math.min(2.4, Math.max(.6, Number(e.toFixed(2)))), h = () => ({
|
|
1441
|
-
scale: r.value,
|
|
1442
|
-
label: `${Math.round(r.value * 100)}%`,
|
|
1443
|
-
canZoomIn: r.value < 2.4,
|
|
1444
|
-
canZoomOut: r.value > .6,
|
|
1445
|
-
canReset: r.value !== 1,
|
|
1446
|
-
minScale: .6,
|
|
1447
|
-
maxScale: 2.4
|
|
1448
|
-
});
|
|
1449
|
-
return ie(r, () => {
|
|
1450
|
-
i.emit();
|
|
1451
|
-
}), te(() => {
|
|
1452
|
-
let e = n.value;
|
|
1453
|
-
e && o(e, {
|
|
1454
|
-
zoomIn: () => (r.value = p(r.value + .1), h()),
|
|
1455
|
-
zoomOut: () => (r.value = p(r.value - .1), h()),
|
|
1456
|
-
resetZoom: () => (r.value = 1, h()),
|
|
1457
|
-
setZoom: (e) => (r.value = p(e), h()),
|
|
1458
|
-
getState: h,
|
|
1459
|
-
subscribe: i.subscribe
|
|
1460
|
-
});
|
|
1461
|
-
}), ee(() => {
|
|
1462
|
-
s(n.value);
|
|
1463
|
-
}), (e, t) => (ne(), d("div", {
|
|
1464
|
-
ref_key: "root",
|
|
1465
|
-
ref: n,
|
|
1466
|
-
class: "markdown-viewer",
|
|
1467
|
-
"data-viewer-zoom-provider": "markdown",
|
|
1468
|
-
style: m(l.value)
|
|
1469
|
-
}, [f("article", {
|
|
1470
|
-
class: "markdown-body",
|
|
1471
|
-
innerHTML: a.value
|
|
1472
|
-
}, null, 8, $e)], 4));
|
|
1473
|
-
}
|
|
1474
|
-
}), [["__scopeId", "data-v-13eb47fd"]]);
|
|
1475
|
-
//#endregion
|
|
1476
|
-
export { et as default };
|