palettecn 0.1.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/dist/index.mjs +10 -0
- package/dist/web/nitro.json +17 -0
- package/dist/web/public/assets/abap-BdvmRIgS.js +1 -0
- package/dist/web/public/assets/actionscript-3-et0rQaqm.js +1 -0
- package/dist/web/public/assets/ada-DPgrustg.js +1 -0
- package/dist/web/public/assets/andromeeda-DJl1yeV_.js +1 -0
- package/dist/web/public/assets/angular-html-Dm7s7tSx.js +1 -0
- package/dist/web/public/assets/angular-ts-B_ywTULt.js +1 -0
- package/dist/web/public/assets/apache-CFpsYX8S.js +1 -0
- package/dist/web/public/assets/apex-CN5n6pbI.js +1 -0
- package/dist/web/public/assets/apl-Dm11wHHc.js +1 -0
- package/dist/web/public/assets/applescript-JrY23hsL.js +1 -0
- package/dist/web/public/assets/ara-DR83hn3A.js +1 -0
- package/dist/web/public/assets/asciidoc-Dpu9XLB1.js +1 -0
- package/dist/web/public/assets/asm-BYI3A31V.js +1 -0
- package/dist/web/public/assets/astro-DP1naDCT.js +1 -0
- package/dist/web/public/assets/aurora-x-Nav5jnoQ.js +1 -0
- package/dist/web/public/assets/awk-BIoTx_w6.js +1 -0
- package/dist/web/public/assets/ayu-dark-H5QV5J7K.js +1 -0
- package/dist/web/public/assets/ayu-light-BrwTNGnU.js +1 -0
- package/dist/web/public/assets/ayu-mirage-Bg6FpF5w.js +1 -0
- package/dist/web/public/assets/ballerina-BFvDNd4T.js +1 -0
- package/dist/web/public/assets/bat-DtQkx7Ny.js +1 -0
- package/dist/web/public/assets/beancount-BIjKALa1.js +1 -0
- package/dist/web/public/assets/berry-BPkDN_EZ.js +1 -0
- package/dist/web/public/assets/bibtex-Dur2CNW6.js +1 -0
- package/dist/web/public/assets/bicep-BMz1bZ7m.js +1 -0
- package/dist/web/public/assets/bird2-91rdr9s7.js +1 -0
- package/dist/web/public/assets/blade-DD5O596X.js +1 -0
- package/dist/web/public/assets/bsl-FmB7U2qd.js +1 -0
- package/dist/web/public/assets/bundle-mjs-Bso3xn9x.js +1 -0
- package/dist/web/public/assets/c-DqqBLLyl.js +1 -0
- package/dist/web/public/assets/c3-CJTbEooS.js +1 -0
- package/dist/web/public/assets/cadence-C0GI7BZZ.js +1 -0
- package/dist/web/public/assets/cairo-B5JMmIC0.js +1 -0
- package/dist/web/public/assets/catppuccin-frappe-D76-cUjK.js +1 -0
- package/dist/web/public/assets/catppuccin-latte-DUHNJ_6_.js +1 -0
- package/dist/web/public/assets/catppuccin-macchiato-CFhPH2wd.js +1 -0
- package/dist/web/public/assets/catppuccin-mocha-BRD0cvUW.js +1 -0
- package/dist/web/public/assets/chunk-FRKYWMV7-DUkk3w4h.js +122 -0
- package/dist/web/public/assets/clarity-KgUVrNfC.js +1 -0
- package/dist/web/public/assets/clojure-BhQuoGIG.js +1 -0
- package/dist/web/public/assets/cmake-CA59gUFQ.js +1 -0
- package/dist/web/public/assets/cobol-CCFShgGZ.js +1 -0
- package/dist/web/public/assets/codeowners-CD36YqjJ.js +1 -0
- package/dist/web/public/assets/codeql-CrMosKUt.js +1 -0
- package/dist/web/public/assets/coffee-C-Mn3tBT.js +1 -0
- package/dist/web/public/assets/common-lisp-DYnOjAFz.js +1 -0
- package/dist/web/public/assets/components-DiZ1dSl3.js +77 -0
- package/dist/web/public/assets/coq-BaHtq3Qt.js +1 -0
- package/dist/web/public/assets/cpp-D8Y73ItU.js +1 -0
- package/dist/web/public/assets/crystal-CnXWqbxx.js +1 -0
- package/dist/web/public/assets/csharp-D6sghVPa.js +1 -0
- package/dist/web/public/assets/css-CUGjdPw_.js +1 -0
- package/dist/web/public/assets/csv-DuxyxUAI.js +1 -0
- package/dist/web/public/assets/cue-D9NRAX0_.js +1 -0
- package/dist/web/public/assets/cypher-HJRdtilF.js +1 -0
- package/dist/web/public/assets/d-B4Ont7_X.js +1 -0
- package/dist/web/public/assets/dark-plus-DZSBycyp.js +1 -0
- package/dist/web/public/assets/dart-Dp4asavE.js +1 -0
- package/dist/web/public/assets/dax-DBUubp6S.js +1 -0
- package/dist/web/public/assets/desktop-DQ0n6zIQ.js +1 -0
- package/dist/web/public/assets/diff-CFHlrffC.js +1 -0
- package/dist/web/public/assets/docker-BuefmsF5.js +1 -0
- package/dist/web/public/assets/dotenv-BKTsUQ_r.js +1 -0
- package/dist/web/public/assets/dracula-MOn9qacs.js +1 -0
- package/dist/web/public/assets/dracula-soft-C4r_sC_D.js +1 -0
- package/dist/web/public/assets/dream-maker-BNdv5lLS.js +1 -0
- package/dist/web/public/assets/edge-C-Mi8Oda.js +1 -0
- package/dist/web/public/assets/elixir-CTS5wQtX.js +1 -0
- package/dist/web/public/assets/elm-rM310x8D.js +1 -0
- package/dist/web/public/assets/emacs-lisp-D9FIGRtM.js +1 -0
- package/dist/web/public/assets/erb-oaGjGVGO.js +1 -0
- package/dist/web/public/assets/erlang-q4Mkyw3m.js +1 -0
- package/dist/web/public/assets/everforest-dark-CNa2QFRn.js +1 -0
- package/dist/web/public/assets/everforest-light-DRbUDqJT.js +1 -0
- package/dist/web/public/assets/fennel-DpqQTaVZ.js +1 -0
- package/dist/web/public/assets/field-1-Ujza0S5j.js +1 -0
- package/dist/web/public/assets/fish-hyk5x6Q4.js +1 -0
- package/dist/web/public/assets/fluent-DMll-MGX.js +1 -0
- package/dist/web/public/assets/fortran-fixed-form-BmdfKovV.js +1 -0
- package/dist/web/public/assets/fortran-free-form-MCAifii4.js +1 -0
- package/dist/web/public/assets/fsharp-DLlBn9Nl.js +1 -0
- package/dist/web/public/assets/gdresource-BzFzBRli.js +1 -0
- package/dist/web/public/assets/gdscript-D3R4J0Cv.js +1 -0
- package/dist/web/public/assets/gdshader-BAubtqqN.js +1 -0
- package/dist/web/public/assets/genie-BnIIX2pC.js +1 -0
- package/dist/web/public/assets/gherkin-CL3NUuB1.js +1 -0
- package/dist/web/public/assets/git-commit-BYPE8h85.js +1 -0
- package/dist/web/public/assets/git-rebase-Bmmgf6eN.js +1 -0
- package/dist/web/public/assets/github-dark-default-C6I2oE4c.js +1 -0
- package/dist/web/public/assets/github-dark-dimmed-DEqwxg6D.js +1 -0
- package/dist/web/public/assets/github-dark-high-contrast-DDt3j0cs.js +1 -0
- package/dist/web/public/assets/github-dark-oLN6SDKl.js +1 -0
- package/dist/web/public/assets/github-light-DaN-N2Gj.js +1 -0
- package/dist/web/public/assets/github-light-default-B3EwMbS7.js +1 -0
- package/dist/web/public/assets/github-light-high-contrast-Cl9D0f_e.js +1 -0
- package/dist/web/public/assets/gleam-Cvj8QRtQ.js +1 -0
- package/dist/web/public/assets/glimmer-js-CahbROb1.js +1 -0
- package/dist/web/public/assets/glimmer-ts-JMFYNbot.js +1 -0
- package/dist/web/public/assets/global-XWAvxWcA.css +2 -0
- package/dist/web/public/assets/glsl-BCuCNM3V.js +1 -0
- package/dist/web/public/assets/gn-DxCHSEMl.js +1 -0
- package/dist/web/public/assets/gnuplot-CkGXHK7B.js +1 -0
- package/dist/web/public/assets/go-B_NLCuTj.js +1 -0
- package/dist/web/public/assets/graphql-RXOfHGfI.js +1 -0
- package/dist/web/public/assets/groovy-DVge8oRs.js +1 -0
- package/dist/web/public/assets/gruvbox-dark-hard-BwZz1yni.js +1 -0
- package/dist/web/public/assets/gruvbox-dark-medium-Bqy6jkuO.js +1 -0
- package/dist/web/public/assets/gruvbox-dark-soft-DjUvyUfH.js +1 -0
- package/dist/web/public/assets/gruvbox-light-hard-BTLmfPdm.js +1 -0
- package/dist/web/public/assets/gruvbox-light-medium-DeWqsWs6.js +1 -0
- package/dist/web/public/assets/gruvbox-light-soft-BL8ld-1F.js +1 -0
- package/dist/web/public/assets/hack-BBQpwyf_.js +1 -0
- package/dist/web/public/assets/haml-mWELc9kh.js +1 -0
- package/dist/web/public/assets/handlebars-COrUo8cC.js +1 -0
- package/dist/web/public/assets/haskell-DRmM8XlQ.js +1 -0
- package/dist/web/public/assets/haxe-BEhq8ZEr.js +1 -0
- package/dist/web/public/assets/hcl-B5ZIaGS0.js +1 -0
- package/dist/web/public/assets/highlighted-body-TPN3WLV5-YJgGFx4e.js +1 -0
- package/dist/web/public/assets/hjson-B9uRLqIO.js +1 -0
- package/dist/web/public/assets/hlsl-Hv1kKjrS.js +1 -0
- package/dist/web/public/assets/horizon-ClXGBjWw.js +1 -0
- package/dist/web/public/assets/horizon-bright-CvUCr3ux.js +1 -0
- package/dist/web/public/assets/houston-NqkqG60q.js +1 -0
- package/dist/web/public/assets/html-cmigv1ou.js +1 -0
- package/dist/web/public/assets/html-derivative-B3me0pSu.js +1 -0
- package/dist/web/public/assets/http-BojM9cyU.js +1 -0
- package/dist/web/public/assets/hurl-BxEmMiGP.js +1 -0
- package/dist/web/public/assets/hxml-CoBuVbfs.js +1 -0
- package/dist/web/public/assets/hy-CeISYGGU.js +1 -0
- package/dist/web/public/assets/imba-xjcDFXUW.js +1 -0
- package/dist/web/public/assets/ini-D0ZCSj6e.js +1 -0
- package/dist/web/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/web/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/web/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/web/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/web/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/web/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/web/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/web/public/assets/java-BvheClGI.js +1 -0
- package/dist/web/public/assets/javascript-DjlJORDg.js +1 -0
- package/dist/web/public/assets/jinja-Bi4sG72X.js +1 -0
- package/dist/web/public/assets/jison-BTz5Ik2Y.js +1 -0
- package/dist/web/public/assets/json-CiTd40Rg.js +1 -0
- package/dist/web/public/assets/json5-FR9EyF7a.js +1 -0
- package/dist/web/public/assets/jsonc-CHIeFfsD.js +1 -0
- package/dist/web/public/assets/jsonl-B4WQkwTf.js +1 -0
- package/dist/web/public/assets/jsonnet-vd-gzGkL.js +1 -0
- package/dist/web/public/assets/jssm-C_bj1LkZ.js +1 -0
- package/dist/web/public/assets/jsx-Bx-RZMFH.js +1 -0
- package/dist/web/public/assets/jsx-runtime-n8k0hwt8.js +1 -0
- package/dist/web/public/assets/julia-BKcIfSxk.js +1 -0
- package/dist/web/public/assets/just-IkZCagAs.js +1 -0
- package/dist/web/public/assets/kanagawa-dragon-B3Cz89vt.js +1 -0
- package/dist/web/public/assets/kanagawa-lotus-CRe_W5Ft.js +1 -0
- package/dist/web/public/assets/kanagawa-wave-BPqZ5XB7.js +1 -0
- package/dist/web/public/assets/kdl-BzL_Ak31.js +1 -0
- package/dist/web/public/assets/kotlin-BQQFk6ql.js +1 -0
- package/dist/web/public/assets/kusto-vWe6OLKV.js +1 -0
- package/dist/web/public/assets/laserwave-CwtvEUcj.js +1 -0
- package/dist/web/public/assets/latex-9N90_WFU.js +1 -0
- package/dist/web/public/assets/lean-CaqenOqv.js +1 -0
- package/dist/web/public/assets/less-CERnPzn6.js +1 -0
- package/dist/web/public/assets/light-plus-B9_M_OKq.js +1 -0
- package/dist/web/public/assets/liquid-CQLPDP7m.js +1 -0
- package/dist/web/public/assets/llvm-BylJXvm7.js +1 -0
- package/dist/web/public/assets/log-CBBcNcbO.js +1 -0
- package/dist/web/public/assets/logo-r-8Jc8Xk.js +1 -0
- package/dist/web/public/assets/lua-BBL6LXKd.js +1 -0
- package/dist/web/public/assets/luau-B2g7L-zP.js +1 -0
- package/dist/web/public/assets/main-0lKVDR64.css +2 -0
- package/dist/web/public/assets/main-CcNf0BOb.js +126 -0
- package/dist/web/public/assets/make-DK-HzJ2w.js +1 -0
- package/dist/web/public/assets/markdown-FgdsukgR.js +1 -0
- package/dist/web/public/assets/marko-CLZwt2N2.js +1 -0
- package/dist/web/public/assets/material-theme-DOJ9PS4O.js +1 -0
- package/dist/web/public/assets/material-theme-darker-DOurH5jT.js +1 -0
- package/dist/web/public/assets/material-theme-lighter-BfPWxCP6.js +1 -0
- package/dist/web/public/assets/material-theme-ocean-BcO5PKoq.js +1 -0
- package/dist/web/public/assets/material-theme-palenight-ClWQBDDd.js +1 -0
- package/dist/web/public/assets/matlab-DwyUVNXd.js +1 -0
- package/dist/web/public/assets/mdc-Bo8CRPg4.js +1 -0
- package/dist/web/public/assets/mdx-3EBShbsD.js +1 -0
- package/dist/web/public/assets/mermaid-ByG2-SLz.js +1 -0
- package/dist/web/public/assets/mermaid-O7DHMXV3-COAgR3aM.js +1 -0
- package/dist/web/public/assets/min-dark-ClJ2x5pc.js +1 -0
- package/dist/web/public/assets/min-light-BsOUz5iE.js +1 -0
- package/dist/web/public/assets/mipsasm-BKDtQCf3.js +1 -0
- package/dist/web/public/assets/mojo-DmEAK7iv.js +1 -0
- package/dist/web/public/assets/monokai-BKc3VADO.js +1 -0
- package/dist/web/public/assets/moonbit-Qm8v_cKN.js +1 -0
- package/dist/web/public/assets/move-CMectUPk.js +1 -0
- package/dist/web/public/assets/narrat-Bdm8NaK8.js +1 -0
- package/dist/web/public/assets/nextflow-BpSt05nC.js +1 -0
- package/dist/web/public/assets/nextflow-groovy-BZ-bqJ-u.js +1 -0
- package/dist/web/public/assets/nginx-ChZL5FWE.js +1 -0
- package/dist/web/public/assets/night-owl-CbFc5pXO.js +1 -0
- package/dist/web/public/assets/night-owl-light-zYbVCVuz.js +1 -0
- package/dist/web/public/assets/nim-5JnPAJWa.js +1 -0
- package/dist/web/public/assets/nix-P5P-2qHs.js +1 -0
- package/dist/web/public/assets/nord-C7hKGudV.js +1 -0
- package/dist/web/public/assets/nushell-DKPnC5RG.js +1 -0
- package/dist/web/public/assets/objective-c-BPwXtM0v.js +1 -0
- package/dist/web/public/assets/objective-cpp-CWYEdWNG.js +1 -0
- package/dist/web/public/assets/ocaml-CL7OJ02v.js +1 -0
- package/dist/web/public/assets/odin-Dtay25eA.js +1 -0
- package/dist/web/public/assets/one-dark-pro-CrdFNNwF.js +1 -0
- package/dist/web/public/assets/one-light-BUiz8X4B.js +1 -0
- package/dist/web/public/assets/openscad-WD4sXUUp.js +1 -0
- package/dist/web/public/assets/pascal-A6-MZnZ8.js +1 -0
- package/dist/web/public/assets/perl-Yq3AfnVV.js +1 -0
- package/dist/web/public/assets/php-CCj0foPx.js +1 -0
- package/dist/web/public/assets/pkl-cmPbg8fI.js +1 -0
- package/dist/web/public/assets/plastic-DtQ_LnDB.js +1 -0
- package/dist/web/public/assets/plsql-DwmuVd7q.js +1 -0
- package/dist/web/public/assets/po-CkVxkZaj.js +1 -0
- package/dist/web/public/assets/poimandres-Dt0xZuaa.js +1 -0
- package/dist/web/public/assets/polar-hStNz_W2.js +1 -0
- package/dist/web/public/assets/postcss-ZIk0AQ7M.js +1 -0
- package/dist/web/public/assets/powerquery-D0gqoHHD.js +1 -0
- package/dist/web/public/assets/powershell-DXB5HoVh.js +1 -0
- package/dist/web/public/assets/prisma-DmTrfxC0.js +1 -0
- package/dist/web/public/assets/prolog-CdoyriEj.js +1 -0
- package/dist/web/public/assets/proto-4MrN11dS.js +1 -0
- package/dist/web/public/assets/pug-svYJKDOQ.js +1 -0
- package/dist/web/public/assets/puppet-MEaLGpAP.js +1 -0
- package/dist/web/public/assets/purescript-CPxCorqB.js +1 -0
- package/dist/web/public/assets/python-f4fp5z0z.js +1 -0
- package/dist/web/public/assets/qml-BzEtWdqI.js +1 -0
- package/dist/web/public/assets/qmldir-DCjSceJ_.js +1 -0
- package/dist/web/public/assets/qss-BdM02NUc.js +1 -0
- package/dist/web/public/assets/r-luosIeJH.js +1 -0
- package/dist/web/public/assets/racket-D2tfa8Zc.js +1 -0
- package/dist/web/public/assets/raku-KeGPJVZg.js +1 -0
- package/dist/web/public/assets/razor-Bokxs4Qx.js +1 -0
- package/dist/web/public/assets/red-C0qZ-1lN.js +1 -0
- package/dist/web/public/assets/reg-DdnswvOj.js +1 -0
- package/dist/web/public/assets/regexp-CYC8h6V9.js +1 -0
- package/dist/web/public/assets/rel-RhzEfSRc.js +1 -0
- package/dist/web/public/assets/riscv-dS5TzX10.js +1 -0
- package/dist/web/public/assets/ron-CQjQSCVp.js +1 -0
- package/dist/web/public/assets/rose-pine-C89ViLdr.js +1 -0
- package/dist/web/public/assets/rose-pine-dawn-Dq2gf0yi.js +1 -0
- package/dist/web/public/assets/rose-pine-moon-CBDvXVs_.js +1 -0
- package/dist/web/public/assets/rosmsg-nvjuSIGu.js +1 -0
- package/dist/web/public/assets/routes-BXqJCOpL.js +542 -0
- package/dist/web/public/assets/rst-1xwvVGf7.js +1 -0
- package/dist/web/public/assets/ruby-Blad-eDx.js +1 -0
- package/dist/web/public/assets/rust-rV8q_xyI.js +1 -0
- package/dist/web/public/assets/sas-DUPWtptg.js +1 -0
- package/dist/web/public/assets/sass-CuxdoNN0.js +1 -0
- package/dist/web/public/assets/scala-Df4L7N3R.js +1 -0
- package/dist/web/public/assets/scheme-DalRmAPH.js +1 -0
- package/dist/web/public/assets/scss-CYQ8LEwP.js +1 -0
- package/dist/web/public/assets/sdbl-B_TmFnGf.js +1 -0
- package/dist/web/public/assets/shaderlab-DYEMDY3e.js +1 -0
- package/dist/web/public/assets/shellscript-DjKZ34ac.js +1 -0
- package/dist/web/public/assets/shellsession-C3kcnBnh.js +1 -0
- package/dist/web/public/assets/slack-dark-ak_jOeLl.js +1 -0
- package/dist/web/public/assets/slack-ochin-ByiYhLwu.js +1 -0
- package/dist/web/public/assets/smalltalk-DTTnjjZJ.js +1 -0
- package/dist/web/public/assets/snazzy-light-BBRYeY60.js +1 -0
- package/dist/web/public/assets/solarized-dark-BtoLnWkw.js +1 -0
- package/dist/web/public/assets/solarized-light-CtzUA7GI.js +1 -0
- package/dist/web/public/assets/solidity-CSIHEQ2t.js +1 -0
- package/dist/web/public/assets/soy-BN0uzUAI.js +1 -0
- package/dist/web/public/assets/sparql-B6k9tA6Q.js +1 -0
- package/dist/web/public/assets/splunk-DkRzN7V_.js +1 -0
- package/dist/web/public/assets/sql-Bx-WX28V.js +1 -0
- package/dist/web/public/assets/ssh-config-Bqp7ng33.js +1 -0
- package/dist/web/public/assets/stata-HAj7doU8.js +1 -0
- package/dist/web/public/assets/stylus-CdbCxDLX.js +1 -0
- package/dist/web/public/assets/surrealql-BkGf0I3k.js +1 -0
- package/dist/web/public/assets/svelte-DtWg6ssL.js +1 -0
- package/dist/web/public/assets/swift-yRu2dtgr.js +1 -0
- package/dist/web/public/assets/synthwave-84-2WIu6MHX.js +1 -0
- package/dist/web/public/assets/system-verilog-GUE_oP1V.js +1 -0
- package/dist/web/public/assets/systemd-FLIJAQZV.js +1 -0
- package/dist/web/public/assets/talonscript-DTR-8ILs.js +1 -0
- package/dist/web/public/assets/tasl-WHNWP-1F.js +1 -0
- package/dist/web/public/assets/tcl-BaBXNNp6.js +1 -0
- package/dist/web/public/assets/templ-Dc9vj00n.js +1 -0
- package/dist/web/public/assets/terraform-uJUFpr8t.js +1 -0
- package/dist/web/public/assets/tex-DA3dAz55.js +1 -0
- package/dist/web/public/assets/tokyo-night-BbogFqAr.js +1 -0
- package/dist/web/public/assets/toml-CyR4Gqq1.js +1 -0
- package/dist/web/public/assets/ts-tags-BD1j21LH.js +1 -0
- package/dist/web/public/assets/tsv-COLVYI6A.js +1 -0
- package/dist/web/public/assets/tsx-CFm2E6uK.js +1 -0
- package/dist/web/public/assets/turtle-PQwt4gkb.js +1 -0
- package/dist/web/public/assets/twig-DrUXy85s.js +1 -0
- package/dist/web/public/assets/typescript-Dy-5sXFx.js +1 -0
- package/dist/web/public/assets/typespec-Bb7qHV0g.js +1 -0
- package/dist/web/public/assets/typst-Bj_JElGz.js +1 -0
- package/dist/web/public/assets/v-BTkrtik4.js +1 -0
- package/dist/web/public/assets/vala-AXT1CI9v.js +1 -0
- package/dist/web/public/assets/vb-DzTKUgW8.js +1 -0
- package/dist/web/public/assets/verilog-aI3j5Xj8.js +1 -0
- package/dist/web/public/assets/vesper-BmnwIC_B.js +1 -0
- package/dist/web/public/assets/vhdl-4IgBB7vO.js +1 -0
- package/dist/web/public/assets/viml-D_XMKSR6.js +1 -0
- package/dist/web/public/assets/vitesse-black-DhmxIXiA.js +1 -0
- package/dist/web/public/assets/vitesse-dark-dvEH_9qt.js +1 -0
- package/dist/web/public/assets/vitesse-light-Ca0W2L1O.js +1 -0
- package/dist/web/public/assets/vue-DC_yTvy2.js +1 -0
- package/dist/web/public/assets/vue-html-Bp8x4gdt.js +1 -0
- package/dist/web/public/assets/vue-vine-ZcUkuUUp.js +1 -0
- package/dist/web/public/assets/vyper-Dz2f7-FK.js +1 -0
- package/dist/web/public/assets/wasm-CuXPCj65.js +1 -0
- package/dist/web/public/assets/wasm-DHkXUMsP.js +1 -0
- package/dist/web/public/assets/wenyan-BRAtM0Iv.js +1 -0
- package/dist/web/public/assets/wgsl-CMpn9jTa.js +1 -0
- package/dist/web/public/assets/wikitext-DRmBVmVA.js +1 -0
- package/dist/web/public/assets/wit-Drp_HLqJ.js +1 -0
- package/dist/web/public/assets/wolfram-C33umj7M.js +1 -0
- package/dist/web/public/assets/xml-BHoOtGbO.js +1 -0
- package/dist/web/public/assets/xsl-CN1PlFqm.js +1 -0
- package/dist/web/public/assets/yaml-DT0mpn8u.js +1 -0
- package/dist/web/public/assets/zenscript-BlYQ_Frf.js +1 -0
- package/dist/web/public/assets/zig-Buk7I0y-.js +1 -0
- package/dist/web/server/_chunks/ssr-renderer.mjs +15 -0
- package/dist/web/server/_libs/@ai-sdk/anthropic+[...].mjs +14021 -0
- package/dist/web/server/_libs/@ai-sdk/moonshotai+[...].mjs +898 -0
- package/dist/web/server/_libs/@ai-sdk/react+[...].mjs +8969 -0
- package/dist/web/server/_libs/@emotion/is-prop-valid+[...].mjs +34 -0
- package/dist/web/server/_libs/@floating-ui/core+[...].mjs +698 -0
- package/dist/web/server/_libs/@floating-ui/dom+[...].mjs +644 -0
- package/dist/web/server/_libs/@floating-ui/react-dom+[...].mjs +475 -0
- package/dist/web/server/_libs/@lobehub/icons+[...].mjs +3079 -0
- package/dist/web/server/_libs/@radix-ui/react-arrow+[...].mjs +184 -0
- package/dist/web/server/_libs/@radix-ui/react-collapsible+[...].mjs +374 -0
- package/dist/web/server/_libs/@radix-ui/react-dialog+[...].mjs +1503 -0
- package/dist/web/server/_libs/@radix-ui/react-menu+[...].mjs +1236 -0
- package/dist/web/server/_libs/@radix-ui/react-select+[...].mjs +1007 -0
- package/dist/web/server/_libs/@shikijs/core+[...].mjs +9017 -0
- package/dist/web/server/_libs/@shikijs/engine-javascript+[...].mjs +3159 -0
- package/dist/web/server/_libs/@streamdown/math+[...].mjs +37559 -0
- package/dist/web/server/_libs/@tanstack/react-router+[...].mjs +14074 -0
- package/dist/web/server/_libs/_.mjs +3 -0
- package/dist/web/server/_libs/_2.mjs +3 -0
- package/dist/web/server/_libs/_3.mjs +2 -0
- package/dist/web/server/_libs/_4.mjs +2 -0
- package/dist/web/server/_libs/ai-sdk__gateway+vercel__oidc.mjs +1255 -0
- package/dist/web/server/_libs/ai-sdk__google.mjs +1630 -0
- package/dist/web/server/_libs/ai-sdk__openai+zod.mjs +4951 -0
- package/dist/web/server/_libs/ai-sdk__provider-utils.mjs +411 -0
- package/dist/web/server/_libs/ai-sdk__provider.mjs +222 -0
- package/dist/web/server/_libs/bail.mjs +13 -0
- package/dist/web/server/_libs/character-entities.mjs +2135 -0
- package/dist/web/server/_libs/class-variance-authority+clsx.mjs +69 -0
- package/dist/web/server/_libs/color+[...].mjs +2185 -0
- package/dist/web/server/_libs/copy-text-to-clipboard.mjs +40 -0
- package/dist/web/server/_libs/d3-array.mjs +231 -0
- package/dist/web/server/_libs/d3-color.mjs +330 -0
- package/dist/web/server/_libs/d3-format.mjs +252 -0
- package/dist/web/server/_libs/d3-interpolate.mjs +207 -0
- package/dist/web/server/_libs/d3-path.mjs +77 -0
- package/dist/web/server/_libs/d3-scale+[...].mjs +1907 -0
- package/dist/web/server/_libs/d3-shape.mjs +818 -0
- package/dist/web/server/_libs/date-fns.mjs +3012 -0
- package/dist/web/server/_libs/date-fns__tz.mjs +249 -0
- package/dist/web/server/_libs/decimal.js-light.mjs +884 -0
- package/dist/web/server/_libs/decode-named-character-reference+[...].mjs +19 -0
- package/dist/web/server/_libs/dexie.mjs +3745 -0
- package/dist/web/server/_libs/escape-string-regexp.mjs +7 -0
- package/dist/web/server/_libs/estree-util-is-identifier-name.mjs +20 -0
- package/dist/web/server/_libs/eventemitter3.mjs +237 -0
- package/dist/web/server/_libs/extend.mjs +75 -0
- package/dist/web/server/_libs/fast-equals.mjs +423 -0
- package/dist/web/server/_libs/framer-motion+[...].mjs +9573 -0
- package/dist/web/server/_libs/fuzzysort.mjs +621 -0
- package/dist/web/server/_libs/h3+rou3+srvx.mjs +1158 -0
- package/dist/web/server/_libs/hast-util-raw+[...].mjs +800 -0
- package/dist/web/server/_libs/hast-util-sanitize.mjs +780 -0
- package/dist/web/server/_libs/hast-util-to-jsx-runtime+[...].mjs +853 -0
- package/dist/web/server/_libs/hookable.mjs +41 -0
- package/dist/web/server/_libs/html-url-attributes.mjs +44 -0
- package/dist/web/server/_libs/is-plain-obj.mjs +8 -0
- package/dist/web/server/_libs/lodash.mjs +4532 -0
- package/dist/web/server/_libs/lucide-react.mjs +605 -0
- package/dist/web/server/_libs/markdown-table.mjs +289 -0
- package/dist/web/server/_libs/marked.mjs +1511 -0
- package/dist/web/server/_libs/mdast-util-find-and-replace.mjs +198 -0
- package/dist/web/server/_libs/mdast-util-from-markdown+[...].mjs +8121 -0
- package/dist/web/server/_libs/mdast-util-gfm+[...].mjs +2060 -0
- package/dist/web/server/_libs/mdast-util-to-hast+[...].mjs +1770 -0
- package/dist/web/server/_libs/micromark-extension-gfm+[...].mjs +2235 -0
- package/dist/web/server/_libs/nanoid.mjs +26 -0
- package/dist/web/server/_libs/next-themes.mjs +124 -0
- package/dist/web/server/_libs/prop-types.mjs +69 -0
- package/dist/web/server/_libs/radix-ui__number.mjs +6 -0
- package/dist/web/server/_libs/radix-ui__primitive.mjs +9 -0
- package/dist/web/server/_libs/radix-ui__react-collection.mjs +80 -0
- package/dist/web/server/_libs/radix-ui__react-direction.mjs +11 -0
- package/dist/web/server/_libs/radix-ui__react-label.mjs +23 -0
- package/dist/web/server/_libs/radix-ui__react-menubar.mjs +400 -0
- package/dist/web/server/_libs/radix-ui__react-popover.mjs +251 -0
- package/dist/web/server/_libs/radix-ui__react-progress.mjs +81 -0
- package/dist/web/server/_libs/radix-ui__react-scroll-area.mjs +669 -0
- package/dist/web/server/_libs/radix-ui__react-separator.mjs +32 -0
- package/dist/web/server/_libs/radix-ui__react-slider.mjs +464 -0
- package/dist/web/server/_libs/radix-ui__react-switch.mjs +120 -0
- package/dist/web/server/_libs/radix-ui__react-tabs.mjs +145 -0
- package/dist/web/server/_libs/radix-ui__react-tooltip.mjs +494 -0
- package/dist/web/server/_libs/react-day-picker.mjs +3510 -0
- package/dist/web/server/_libs/react-is.mjs +48 -0
- package/dist/web/server/_libs/react-resizable-panels.mjs +1517 -0
- package/dist/web/server/_libs/react-smooth.mjs +1024 -0
- package/dist/web/server/_libs/recharts+[...].mjs +12998 -0
- package/dist/web/server/_libs/rehype-harden.mjs +210 -0
- package/dist/web/server/_libs/rehype-raw.mjs +37 -0
- package/dist/web/server/_libs/rehype-sanitize.mjs +27 -0
- package/dist/web/server/_libs/remark-gfm.mjs +34 -0
- package/dist/web/server/_libs/remark-parse.mjs +37 -0
- package/dist/web/server/_libs/remark-rehype.mjs +169 -0
- package/dist/web/server/_libs/remend.mjs +544 -0
- package/dist/web/server/_libs/scule.mjs +55 -0
- package/dist/web/server/_libs/shiki+streamdown__code.mjs +1748 -0
- package/dist/web/server/_libs/shiki.mjs +16 -0
- package/dist/web/server/_libs/shikijs__engine-oniguruma.mjs +387 -0
- package/dist/web/server/_libs/shikijs__langs.mjs +1357 -0
- package/dist/web/server/_libs/shikijs__themes.mjs +268 -0
- package/dist/web/server/_libs/sonner.mjs +909 -0
- package/dist/web/server/_libs/streamdown+[...].mjs +5842 -0
- package/dist/web/server/_libs/tanstack__history.mjs +342 -0
- package/dist/web/server/_libs/tanstack__query-core.mjs +2073 -0
- package/dist/web/server/_libs/tanstack__react-query.mjs +146 -0
- package/dist/web/server/_libs/tanstack__router-core.mjs +6 -0
- package/dist/web/server/_libs/tanstack__zod-adapter.mjs +16 -0
- package/dist/web/server/_libs/ufo.mjs +64 -0
- package/dist/web/server/_libs/ungap__structured-clone.mjs +197 -0
- package/dist/web/server/_libs/use-stick-to-bottom.mjs +410 -0
- package/dist/web/server/_libs/vercel__oidc.mjs +393 -0
- package/dist/web/server/_libs/zhipu-ai-provider.mjs +13483 -0
- package/dist/web/server/_libs/zustand.mjs +48 -0
- package/dist/web/server/_runtime.mjs +35 -0
- package/dist/web/server/_ssr/components-BzCiScpA.mjs +1452 -0
- package/dist/web/server/_ssr/dist-3Mu7PF0n.mjs +137 -0
- package/dist/web/server/_ssr/dist-BRaLXgxZ.mjs +17 -0
- package/dist/web/server/_ssr/field-1-agM60DBf.mjs +167 -0
- package/dist/web/server/_ssr/get-providers-BoYkp0Of.mjs +40 -0
- package/dist/web/server/_ssr/initialize-provider-B6W8V5Eg.mjs +19 -0
- package/dist/web/server/_ssr/model-list-CDFjdz2P.mjs +60 -0
- package/dist/web/server/_ssr/router-BmmOCtJZ.mjs +168 -0
- package/dist/web/server/_ssr/routes-CvlpZK4Q.mjs +2630 -0
- package/dist/web/server/_ssr/schemas-DsZ5O3zp.mjs +67 -0
- package/dist/web/server/_ssr/send-message-DUT1vRvx.mjs +135 -0
- package/dist/web/server/_ssr/ssr.mjs +5253 -0
- package/dist/web/server/_ssr/start-rewezkfD.mjs +4 -0
- package/dist/web/server/_ssr/submit-key-CcCv6-yy.mjs +62 -0
- package/dist/web/server/_ssr/suggestions-B0Uc3p7F.mjs +38 -0
- package/dist/web/server/_ssr/use-providers-Bwqg2U3N.mjs +1554 -0
- package/dist/web/server/_tanstack-start-manifest_v-BMIvh4y6.mjs +60 -0
- package/dist/web/server/index.mjs +2531 -0
- package/dist/web/server/node_modules/tslib/modules/index.js +70 -0
- package/dist/web/server/node_modules/tslib/modules/package.json +3 -0
- package/dist/web/server/node_modules/tslib/package.json +47 -0
- package/dist/web/server/node_modules/tslib/tslib.js +484 -0
- package/package.json +32 -0
|
@@ -0,0 +1,2235 @@
|
|
|
1
|
+
import { a as asciiAlphanumeric, d as markdownLineEnding, f as markdownLineEndingOrSpace, h as unicodeWhitespace, i as asciiAlpha, m as unicodePunctuation, n as factorySpace, p as markdownSpace, s as asciiControl } from "./@streamdown/math+[...].mjs";
|
|
2
|
+
import { a as classifyCharacter, c as splice, n as blankLine, o as normalizeIdentifier, r as combineExtensions, s as resolveAll } from "./mdast-util-from-markdown+[...].mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/micromark-extension-gfm-autolink-literal@2.1.0/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js
|
|
4
|
+
/**
|
|
5
|
+
* @import {Code, ConstructRecord, Event, Extension, Previous, State, TokenizeContext, Tokenizer} from 'micromark-util-types'
|
|
6
|
+
*/
|
|
7
|
+
var wwwPrefix = {
|
|
8
|
+
tokenize: tokenizeWwwPrefix,
|
|
9
|
+
partial: true
|
|
10
|
+
};
|
|
11
|
+
var domain = {
|
|
12
|
+
tokenize: tokenizeDomain,
|
|
13
|
+
partial: true
|
|
14
|
+
};
|
|
15
|
+
var path = {
|
|
16
|
+
tokenize: tokenizePath,
|
|
17
|
+
partial: true
|
|
18
|
+
};
|
|
19
|
+
var trail = {
|
|
20
|
+
tokenize: tokenizeTrail,
|
|
21
|
+
partial: true
|
|
22
|
+
};
|
|
23
|
+
var emailDomainDotTrail = {
|
|
24
|
+
tokenize: tokenizeEmailDomainDotTrail,
|
|
25
|
+
partial: true
|
|
26
|
+
};
|
|
27
|
+
var wwwAutolink = {
|
|
28
|
+
name: "wwwAutolink",
|
|
29
|
+
tokenize: tokenizeWwwAutolink,
|
|
30
|
+
previous: previousWww
|
|
31
|
+
};
|
|
32
|
+
var protocolAutolink = {
|
|
33
|
+
name: "protocolAutolink",
|
|
34
|
+
tokenize: tokenizeProtocolAutolink,
|
|
35
|
+
previous: previousProtocol
|
|
36
|
+
};
|
|
37
|
+
var emailAutolink = {
|
|
38
|
+
name: "emailAutolink",
|
|
39
|
+
tokenize: tokenizeEmailAutolink,
|
|
40
|
+
previous: previousEmail
|
|
41
|
+
};
|
|
42
|
+
/** @type {ConstructRecord} */
|
|
43
|
+
var text = {};
|
|
44
|
+
/**
|
|
45
|
+
* Create an extension for `micromark` to support GitHub autolink literal
|
|
46
|
+
* syntax.
|
|
47
|
+
*
|
|
48
|
+
* @returns {Extension}
|
|
49
|
+
* Extension for `micromark` that can be passed in `extensions` to enable GFM
|
|
50
|
+
* autolink literal syntax.
|
|
51
|
+
*/
|
|
52
|
+
function gfmAutolinkLiteral() {
|
|
53
|
+
return { text };
|
|
54
|
+
}
|
|
55
|
+
/** @type {Code} */
|
|
56
|
+
var code = 48;
|
|
57
|
+
while (code < 123) {
|
|
58
|
+
text[code] = emailAutolink;
|
|
59
|
+
code++;
|
|
60
|
+
if (code === 58) code = 65;
|
|
61
|
+
else if (code === 91) code = 97;
|
|
62
|
+
}
|
|
63
|
+
text[43] = emailAutolink;
|
|
64
|
+
text[45] = emailAutolink;
|
|
65
|
+
text[46] = emailAutolink;
|
|
66
|
+
text[95] = emailAutolink;
|
|
67
|
+
text[72] = [emailAutolink, protocolAutolink];
|
|
68
|
+
text[104] = [emailAutolink, protocolAutolink];
|
|
69
|
+
text[87] = [emailAutolink, wwwAutolink];
|
|
70
|
+
text[119] = [emailAutolink, wwwAutolink];
|
|
71
|
+
/**
|
|
72
|
+
* Email autolink literal.
|
|
73
|
+
*
|
|
74
|
+
* ```markdown
|
|
75
|
+
* > | a contact@example.org b
|
|
76
|
+
* ^^^^^^^^^^^^^^^^^^^
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @this {TokenizeContext}
|
|
80
|
+
* @type {Tokenizer}
|
|
81
|
+
*/
|
|
82
|
+
function tokenizeEmailAutolink(effects, ok, nok) {
|
|
83
|
+
const self = this;
|
|
84
|
+
/** @type {boolean | undefined} */
|
|
85
|
+
let dot;
|
|
86
|
+
/** @type {boolean} */
|
|
87
|
+
let data;
|
|
88
|
+
return start;
|
|
89
|
+
/**
|
|
90
|
+
* Start of email autolink literal.
|
|
91
|
+
*
|
|
92
|
+
* ```markdown
|
|
93
|
+
* > | a contact@example.org b
|
|
94
|
+
* ^
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* @type {State}
|
|
98
|
+
*/
|
|
99
|
+
function start(code) {
|
|
100
|
+
if (!gfmAtext(code) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) return nok(code);
|
|
101
|
+
effects.enter("literalAutolink");
|
|
102
|
+
effects.enter("literalAutolinkEmail");
|
|
103
|
+
return atext(code);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* In email atext.
|
|
107
|
+
*
|
|
108
|
+
* ```markdown
|
|
109
|
+
* > | a contact@example.org b
|
|
110
|
+
* ^
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @type {State}
|
|
114
|
+
*/
|
|
115
|
+
function atext(code) {
|
|
116
|
+
if (gfmAtext(code)) {
|
|
117
|
+
effects.consume(code);
|
|
118
|
+
return atext;
|
|
119
|
+
}
|
|
120
|
+
if (code === 64) {
|
|
121
|
+
effects.consume(code);
|
|
122
|
+
return emailDomain;
|
|
123
|
+
}
|
|
124
|
+
return nok(code);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* In email domain.
|
|
128
|
+
*
|
|
129
|
+
* The reference code is a bit overly complex as it handles the `@`, of which
|
|
130
|
+
* there may be just one.
|
|
131
|
+
* Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L318>
|
|
132
|
+
*
|
|
133
|
+
* ```markdown
|
|
134
|
+
* > | a contact@example.org b
|
|
135
|
+
* ^
|
|
136
|
+
* ```
|
|
137
|
+
*
|
|
138
|
+
* @type {State}
|
|
139
|
+
*/
|
|
140
|
+
function emailDomain(code) {
|
|
141
|
+
if (code === 46) return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code);
|
|
142
|
+
if (code === 45 || code === 95 || asciiAlphanumeric(code)) {
|
|
143
|
+
data = true;
|
|
144
|
+
effects.consume(code);
|
|
145
|
+
return emailDomain;
|
|
146
|
+
}
|
|
147
|
+
return emailDomainAfter(code);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* In email domain, on dot that is not a trail.
|
|
151
|
+
*
|
|
152
|
+
* ```markdown
|
|
153
|
+
* > | a contact@example.org b
|
|
154
|
+
* ^
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* @type {State}
|
|
158
|
+
*/
|
|
159
|
+
function emailDomainDot(code) {
|
|
160
|
+
effects.consume(code);
|
|
161
|
+
dot = true;
|
|
162
|
+
return emailDomain;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* After email domain.
|
|
166
|
+
*
|
|
167
|
+
* ```markdown
|
|
168
|
+
* > | a contact@example.org b
|
|
169
|
+
* ^
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* @type {State}
|
|
173
|
+
*/
|
|
174
|
+
function emailDomainAfter(code) {
|
|
175
|
+
if (data && dot && asciiAlpha(self.previous)) {
|
|
176
|
+
effects.exit("literalAutolinkEmail");
|
|
177
|
+
effects.exit("literalAutolink");
|
|
178
|
+
return ok(code);
|
|
179
|
+
}
|
|
180
|
+
return nok(code);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* `www` autolink literal.
|
|
185
|
+
*
|
|
186
|
+
* ```markdown
|
|
187
|
+
* > | a www.example.org b
|
|
188
|
+
* ^^^^^^^^^^^^^^^
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* @this {TokenizeContext}
|
|
192
|
+
* @type {Tokenizer}
|
|
193
|
+
*/
|
|
194
|
+
function tokenizeWwwAutolink(effects, ok, nok) {
|
|
195
|
+
const self = this;
|
|
196
|
+
return wwwStart;
|
|
197
|
+
/**
|
|
198
|
+
* Start of www autolink literal.
|
|
199
|
+
*
|
|
200
|
+
* ```markdown
|
|
201
|
+
* > | www.example.com/a?b#c
|
|
202
|
+
* ^
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* @type {State}
|
|
206
|
+
*/
|
|
207
|
+
function wwwStart(code) {
|
|
208
|
+
if (code !== 87 && code !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) return nok(code);
|
|
209
|
+
effects.enter("literalAutolink");
|
|
210
|
+
effects.enter("literalAutolinkWww");
|
|
211
|
+
return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* After a www autolink literal.
|
|
215
|
+
*
|
|
216
|
+
* ```markdown
|
|
217
|
+
* > | www.example.com/a?b#c
|
|
218
|
+
* ^
|
|
219
|
+
* ```
|
|
220
|
+
*
|
|
221
|
+
* @type {State}
|
|
222
|
+
*/
|
|
223
|
+
function wwwAfter(code) {
|
|
224
|
+
effects.exit("literalAutolinkWww");
|
|
225
|
+
effects.exit("literalAutolink");
|
|
226
|
+
return ok(code);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Protocol autolink literal.
|
|
231
|
+
*
|
|
232
|
+
* ```markdown
|
|
233
|
+
* > | a https://example.org b
|
|
234
|
+
* ^^^^^^^^^^^^^^^^^^^
|
|
235
|
+
* ```
|
|
236
|
+
*
|
|
237
|
+
* @this {TokenizeContext}
|
|
238
|
+
* @type {Tokenizer}
|
|
239
|
+
*/
|
|
240
|
+
function tokenizeProtocolAutolink(effects, ok, nok) {
|
|
241
|
+
const self = this;
|
|
242
|
+
let buffer = "";
|
|
243
|
+
let seen = false;
|
|
244
|
+
return protocolStart;
|
|
245
|
+
/**
|
|
246
|
+
* Start of protocol autolink literal.
|
|
247
|
+
*
|
|
248
|
+
* ```markdown
|
|
249
|
+
* > | https://example.com/a?b#c
|
|
250
|
+
* ^
|
|
251
|
+
* ```
|
|
252
|
+
*
|
|
253
|
+
* @type {State}
|
|
254
|
+
*/
|
|
255
|
+
function protocolStart(code) {
|
|
256
|
+
if ((code === 72 || code === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {
|
|
257
|
+
effects.enter("literalAutolink");
|
|
258
|
+
effects.enter("literalAutolinkHttp");
|
|
259
|
+
buffer += String.fromCodePoint(code);
|
|
260
|
+
effects.consume(code);
|
|
261
|
+
return protocolPrefixInside;
|
|
262
|
+
}
|
|
263
|
+
return nok(code);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* In protocol.
|
|
267
|
+
*
|
|
268
|
+
* ```markdown
|
|
269
|
+
* > | https://example.com/a?b#c
|
|
270
|
+
* ^^^^^
|
|
271
|
+
* ```
|
|
272
|
+
*
|
|
273
|
+
* @type {State}
|
|
274
|
+
*/
|
|
275
|
+
function protocolPrefixInside(code) {
|
|
276
|
+
if (asciiAlpha(code) && buffer.length < 5) {
|
|
277
|
+
buffer += String.fromCodePoint(code);
|
|
278
|
+
effects.consume(code);
|
|
279
|
+
return protocolPrefixInside;
|
|
280
|
+
}
|
|
281
|
+
if (code === 58) {
|
|
282
|
+
const protocol = buffer.toLowerCase();
|
|
283
|
+
if (protocol === "http" || protocol === "https") {
|
|
284
|
+
effects.consume(code);
|
|
285
|
+
return protocolSlashesInside;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return nok(code);
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* In slashes.
|
|
292
|
+
*
|
|
293
|
+
* ```markdown
|
|
294
|
+
* > | https://example.com/a?b#c
|
|
295
|
+
* ^^
|
|
296
|
+
* ```
|
|
297
|
+
*
|
|
298
|
+
* @type {State}
|
|
299
|
+
*/
|
|
300
|
+
function protocolSlashesInside(code) {
|
|
301
|
+
if (code === 47) {
|
|
302
|
+
effects.consume(code);
|
|
303
|
+
if (seen) return afterProtocol;
|
|
304
|
+
seen = true;
|
|
305
|
+
return protocolSlashesInside;
|
|
306
|
+
}
|
|
307
|
+
return nok(code);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* After protocol, before domain.
|
|
311
|
+
*
|
|
312
|
+
* ```markdown
|
|
313
|
+
* > | https://example.com/a?b#c
|
|
314
|
+
* ^
|
|
315
|
+
* ```
|
|
316
|
+
*
|
|
317
|
+
* @type {State}
|
|
318
|
+
*/
|
|
319
|
+
function afterProtocol(code) {
|
|
320
|
+
return code === null || asciiControl(code) || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || unicodePunctuation(code) ? nok(code) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* After a protocol autolink literal.
|
|
324
|
+
*
|
|
325
|
+
* ```markdown
|
|
326
|
+
* > | https://example.com/a?b#c
|
|
327
|
+
* ^
|
|
328
|
+
* ```
|
|
329
|
+
*
|
|
330
|
+
* @type {State}
|
|
331
|
+
*/
|
|
332
|
+
function protocolAfter(code) {
|
|
333
|
+
effects.exit("literalAutolinkHttp");
|
|
334
|
+
effects.exit("literalAutolink");
|
|
335
|
+
return ok(code);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* `www` prefix.
|
|
340
|
+
*
|
|
341
|
+
* ```markdown
|
|
342
|
+
* > | a www.example.org b
|
|
343
|
+
* ^^^^
|
|
344
|
+
* ```
|
|
345
|
+
*
|
|
346
|
+
* @this {TokenizeContext}
|
|
347
|
+
* @type {Tokenizer}
|
|
348
|
+
*/
|
|
349
|
+
function tokenizeWwwPrefix(effects, ok, nok) {
|
|
350
|
+
let size = 0;
|
|
351
|
+
return wwwPrefixInside;
|
|
352
|
+
/**
|
|
353
|
+
* In www prefix.
|
|
354
|
+
*
|
|
355
|
+
* ```markdown
|
|
356
|
+
* > | www.example.com
|
|
357
|
+
* ^^^^
|
|
358
|
+
* ```
|
|
359
|
+
*
|
|
360
|
+
* @type {State}
|
|
361
|
+
*/
|
|
362
|
+
function wwwPrefixInside(code) {
|
|
363
|
+
if ((code === 87 || code === 119) && size < 3) {
|
|
364
|
+
size++;
|
|
365
|
+
effects.consume(code);
|
|
366
|
+
return wwwPrefixInside;
|
|
367
|
+
}
|
|
368
|
+
if (code === 46 && size === 3) {
|
|
369
|
+
effects.consume(code);
|
|
370
|
+
return wwwPrefixAfter;
|
|
371
|
+
}
|
|
372
|
+
return nok(code);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* After www prefix.
|
|
376
|
+
*
|
|
377
|
+
* ```markdown
|
|
378
|
+
* > | www.example.com
|
|
379
|
+
* ^
|
|
380
|
+
* ```
|
|
381
|
+
*
|
|
382
|
+
* @type {State}
|
|
383
|
+
*/
|
|
384
|
+
function wwwPrefixAfter(code) {
|
|
385
|
+
return code === null ? nok(code) : ok(code);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Domain.
|
|
390
|
+
*
|
|
391
|
+
* ```markdown
|
|
392
|
+
* > | a https://example.org b
|
|
393
|
+
* ^^^^^^^^^^^
|
|
394
|
+
* ```
|
|
395
|
+
*
|
|
396
|
+
* @this {TokenizeContext}
|
|
397
|
+
* @type {Tokenizer}
|
|
398
|
+
*/
|
|
399
|
+
function tokenizeDomain(effects, ok, nok) {
|
|
400
|
+
/** @type {boolean | undefined} */
|
|
401
|
+
let underscoreInLastSegment;
|
|
402
|
+
/** @type {boolean | undefined} */
|
|
403
|
+
let underscoreInLastLastSegment;
|
|
404
|
+
/** @type {boolean | undefined} */
|
|
405
|
+
let seen;
|
|
406
|
+
return domainInside;
|
|
407
|
+
/**
|
|
408
|
+
* In domain.
|
|
409
|
+
*
|
|
410
|
+
* ```markdown
|
|
411
|
+
* > | https://example.com/a
|
|
412
|
+
* ^^^^^^^^^^^
|
|
413
|
+
* ```
|
|
414
|
+
*
|
|
415
|
+
* @type {State}
|
|
416
|
+
*/
|
|
417
|
+
function domainInside(code) {
|
|
418
|
+
if (code === 46 || code === 95) return effects.check(trail, domainAfter, domainAtPunctuation)(code);
|
|
419
|
+
if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || code !== 45 && unicodePunctuation(code)) return domainAfter(code);
|
|
420
|
+
seen = true;
|
|
421
|
+
effects.consume(code);
|
|
422
|
+
return domainInside;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* In domain, at potential trailing punctuation, that was not trailing.
|
|
426
|
+
*
|
|
427
|
+
* ```markdown
|
|
428
|
+
* > | https://example.com
|
|
429
|
+
* ^
|
|
430
|
+
* ```
|
|
431
|
+
*
|
|
432
|
+
* @type {State}
|
|
433
|
+
*/
|
|
434
|
+
function domainAtPunctuation(code) {
|
|
435
|
+
if (code === 95) underscoreInLastSegment = true;
|
|
436
|
+
else {
|
|
437
|
+
underscoreInLastLastSegment = underscoreInLastSegment;
|
|
438
|
+
underscoreInLastSegment = void 0;
|
|
439
|
+
}
|
|
440
|
+
effects.consume(code);
|
|
441
|
+
return domainInside;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* After domain.
|
|
445
|
+
*
|
|
446
|
+
* ```markdown
|
|
447
|
+
* > | https://example.com/a
|
|
448
|
+
* ^
|
|
449
|
+
* ```
|
|
450
|
+
*
|
|
451
|
+
* @type {State} */
|
|
452
|
+
function domainAfter(code) {
|
|
453
|
+
if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) return nok(code);
|
|
454
|
+
return ok(code);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Path.
|
|
459
|
+
*
|
|
460
|
+
* ```markdown
|
|
461
|
+
* > | a https://example.org/stuff b
|
|
462
|
+
* ^^^^^^
|
|
463
|
+
* ```
|
|
464
|
+
*
|
|
465
|
+
* @this {TokenizeContext}
|
|
466
|
+
* @type {Tokenizer}
|
|
467
|
+
*/
|
|
468
|
+
function tokenizePath(effects, ok) {
|
|
469
|
+
let sizeOpen = 0;
|
|
470
|
+
let sizeClose = 0;
|
|
471
|
+
return pathInside;
|
|
472
|
+
/**
|
|
473
|
+
* In path.
|
|
474
|
+
*
|
|
475
|
+
* ```markdown
|
|
476
|
+
* > | https://example.com/a
|
|
477
|
+
* ^^
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
480
|
+
* @type {State}
|
|
481
|
+
*/
|
|
482
|
+
function pathInside(code) {
|
|
483
|
+
if (code === 40) {
|
|
484
|
+
sizeOpen++;
|
|
485
|
+
effects.consume(code);
|
|
486
|
+
return pathInside;
|
|
487
|
+
}
|
|
488
|
+
if (code === 41 && sizeClose < sizeOpen) return pathAtPunctuation(code);
|
|
489
|
+
if (code === 33 || code === 34 || code === 38 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 60 || code === 63 || code === 93 || code === 95 || code === 126) return effects.check(trail, ok, pathAtPunctuation)(code);
|
|
490
|
+
if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return ok(code);
|
|
491
|
+
effects.consume(code);
|
|
492
|
+
return pathInside;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* In path, at potential trailing punctuation, that was not trailing.
|
|
496
|
+
*
|
|
497
|
+
* ```markdown
|
|
498
|
+
* > | https://example.com/a"b
|
|
499
|
+
* ^
|
|
500
|
+
* ```
|
|
501
|
+
*
|
|
502
|
+
* @type {State}
|
|
503
|
+
*/
|
|
504
|
+
function pathAtPunctuation(code) {
|
|
505
|
+
if (code === 41) sizeClose++;
|
|
506
|
+
effects.consume(code);
|
|
507
|
+
return pathInside;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Trail.
|
|
512
|
+
*
|
|
513
|
+
* This calls `ok` if this *is* the trail, followed by an end, which means
|
|
514
|
+
* the entire trail is not part of the link.
|
|
515
|
+
* It calls `nok` if this *is* part of the link.
|
|
516
|
+
*
|
|
517
|
+
* ```markdown
|
|
518
|
+
* > | https://example.com").
|
|
519
|
+
* ^^^
|
|
520
|
+
* ```
|
|
521
|
+
*
|
|
522
|
+
* @this {TokenizeContext}
|
|
523
|
+
* @type {Tokenizer}
|
|
524
|
+
*/
|
|
525
|
+
function tokenizeTrail(effects, ok, nok) {
|
|
526
|
+
return trail;
|
|
527
|
+
/**
|
|
528
|
+
* In trail of domain or path.
|
|
529
|
+
*
|
|
530
|
+
* ```markdown
|
|
531
|
+
* > | https://example.com").
|
|
532
|
+
* ^
|
|
533
|
+
* ```
|
|
534
|
+
*
|
|
535
|
+
* @type {State}
|
|
536
|
+
*/
|
|
537
|
+
function trail(code) {
|
|
538
|
+
if (code === 33 || code === 34 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 63 || code === 95 || code === 126) {
|
|
539
|
+
effects.consume(code);
|
|
540
|
+
return trail;
|
|
541
|
+
}
|
|
542
|
+
if (code === 38) {
|
|
543
|
+
effects.consume(code);
|
|
544
|
+
return trailCharacterReferenceStart;
|
|
545
|
+
}
|
|
546
|
+
if (code === 93) {
|
|
547
|
+
effects.consume(code);
|
|
548
|
+
return trailBracketAfter;
|
|
549
|
+
}
|
|
550
|
+
if (code === 60 || code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return ok(code);
|
|
551
|
+
return nok(code);
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* In trail, after `]`.
|
|
555
|
+
*
|
|
556
|
+
* > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug.
|
|
557
|
+
* > See end of <https://github.com/github/cmark-gfm/issues/278> for more.
|
|
558
|
+
*
|
|
559
|
+
* ```markdown
|
|
560
|
+
* > | https://example.com](
|
|
561
|
+
* ^
|
|
562
|
+
* ```
|
|
563
|
+
*
|
|
564
|
+
* @type {State}
|
|
565
|
+
*/
|
|
566
|
+
function trailBracketAfter(code) {
|
|
567
|
+
if (code === null || code === 40 || code === 91 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return ok(code);
|
|
568
|
+
return trail(code);
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* In character-reference like trail, after `&`.
|
|
572
|
+
*
|
|
573
|
+
* ```markdown
|
|
574
|
+
* > | https://example.com&).
|
|
575
|
+
* ^
|
|
576
|
+
* ```
|
|
577
|
+
*
|
|
578
|
+
* @type {State}
|
|
579
|
+
*/
|
|
580
|
+
function trailCharacterReferenceStart(code) {
|
|
581
|
+
return asciiAlpha(code) ? trailCharacterReferenceInside(code) : nok(code);
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* In character-reference like trail.
|
|
585
|
+
*
|
|
586
|
+
* ```markdown
|
|
587
|
+
* > | https://example.com&).
|
|
588
|
+
* ^
|
|
589
|
+
* ```
|
|
590
|
+
*
|
|
591
|
+
* @type {State}
|
|
592
|
+
*/
|
|
593
|
+
function trailCharacterReferenceInside(code) {
|
|
594
|
+
if (code === 59) {
|
|
595
|
+
effects.consume(code);
|
|
596
|
+
return trail;
|
|
597
|
+
}
|
|
598
|
+
if (asciiAlpha(code)) {
|
|
599
|
+
effects.consume(code);
|
|
600
|
+
return trailCharacterReferenceInside;
|
|
601
|
+
}
|
|
602
|
+
return nok(code);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Dot in email domain trail.
|
|
607
|
+
*
|
|
608
|
+
* This calls `ok` if this *is* the trail, followed by an end, which means
|
|
609
|
+
* the trail is not part of the link.
|
|
610
|
+
* It calls `nok` if this *is* part of the link.
|
|
611
|
+
*
|
|
612
|
+
* ```markdown
|
|
613
|
+
* > | contact@example.org.
|
|
614
|
+
* ^
|
|
615
|
+
* ```
|
|
616
|
+
*
|
|
617
|
+
* @this {TokenizeContext}
|
|
618
|
+
* @type {Tokenizer}
|
|
619
|
+
*/
|
|
620
|
+
function tokenizeEmailDomainDotTrail(effects, ok, nok) {
|
|
621
|
+
return start;
|
|
622
|
+
/**
|
|
623
|
+
* Dot.
|
|
624
|
+
*
|
|
625
|
+
* ```markdown
|
|
626
|
+
* > | contact@example.org.
|
|
627
|
+
* ^ ^
|
|
628
|
+
* ```
|
|
629
|
+
*
|
|
630
|
+
* @type {State}
|
|
631
|
+
*/
|
|
632
|
+
function start(code) {
|
|
633
|
+
effects.consume(code);
|
|
634
|
+
return after;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* After dot.
|
|
638
|
+
*
|
|
639
|
+
* ```markdown
|
|
640
|
+
* > | contact@example.org.
|
|
641
|
+
* ^ ^
|
|
642
|
+
* ```
|
|
643
|
+
*
|
|
644
|
+
* @type {State}
|
|
645
|
+
*/
|
|
646
|
+
function after(code) {
|
|
647
|
+
return asciiAlphanumeric(code) ? nok(code) : ok(code);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* See:
|
|
652
|
+
* <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L156>.
|
|
653
|
+
*
|
|
654
|
+
* @type {Previous}
|
|
655
|
+
*/
|
|
656
|
+
function previousWww(code) {
|
|
657
|
+
return code === null || code === 40 || code === 42 || code === 95 || code === 91 || code === 93 || code === 126 || markdownLineEndingOrSpace(code);
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* See:
|
|
661
|
+
* <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L214>.
|
|
662
|
+
*
|
|
663
|
+
* @type {Previous}
|
|
664
|
+
*/
|
|
665
|
+
function previousProtocol(code) {
|
|
666
|
+
return !asciiAlpha(code);
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* @this {TokenizeContext}
|
|
670
|
+
* @type {Previous}
|
|
671
|
+
*/
|
|
672
|
+
function previousEmail(code) {
|
|
673
|
+
return !(code === 47 || gfmAtext(code));
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* @param {Code} code
|
|
677
|
+
* @returns {boolean}
|
|
678
|
+
*/
|
|
679
|
+
function gfmAtext(code) {
|
|
680
|
+
return code === 43 || code === 45 || code === 46 || code === 95 || asciiAlphanumeric(code);
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* @param {Array<Event>} events
|
|
684
|
+
* @returns {boolean}
|
|
685
|
+
*/
|
|
686
|
+
function previousUnbalanced(events) {
|
|
687
|
+
let index = events.length;
|
|
688
|
+
let result = false;
|
|
689
|
+
while (index--) {
|
|
690
|
+
const token = events[index][1];
|
|
691
|
+
if ((token.type === "labelLink" || token.type === "labelImage") && !token._balanced) {
|
|
692
|
+
result = true;
|
|
693
|
+
break;
|
|
694
|
+
}
|
|
695
|
+
if (token._gfmAutolinkLiteralWalkedInto) {
|
|
696
|
+
result = false;
|
|
697
|
+
break;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
if (events.length > 0 && !result) events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;
|
|
701
|
+
return result;
|
|
702
|
+
}
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region ../../node_modules/.pnpm/micromark-extension-gfm-footnote@2.1.0/node_modules/micromark-extension-gfm-footnote/lib/syntax.js
|
|
705
|
+
/**
|
|
706
|
+
* @import {Event, Exiter, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
|
|
707
|
+
*/
|
|
708
|
+
var indent = {
|
|
709
|
+
tokenize: tokenizeIndent,
|
|
710
|
+
partial: true
|
|
711
|
+
};
|
|
712
|
+
/**
|
|
713
|
+
* Create an extension for `micromark` to enable GFM footnote syntax.
|
|
714
|
+
*
|
|
715
|
+
* @returns {Extension}
|
|
716
|
+
* Extension for `micromark` that can be passed in `extensions` to
|
|
717
|
+
* enable GFM footnote syntax.
|
|
718
|
+
*/
|
|
719
|
+
function gfmFootnote() {
|
|
720
|
+
/** @type {Extension} */
|
|
721
|
+
return {
|
|
722
|
+
document: { [91]: {
|
|
723
|
+
name: "gfmFootnoteDefinition",
|
|
724
|
+
tokenize: tokenizeDefinitionStart,
|
|
725
|
+
continuation: { tokenize: tokenizeDefinitionContinuation },
|
|
726
|
+
exit: gfmFootnoteDefinitionEnd
|
|
727
|
+
} },
|
|
728
|
+
text: {
|
|
729
|
+
[91]: {
|
|
730
|
+
name: "gfmFootnoteCall",
|
|
731
|
+
tokenize: tokenizeGfmFootnoteCall
|
|
732
|
+
},
|
|
733
|
+
[93]: {
|
|
734
|
+
name: "gfmPotentialFootnoteCall",
|
|
735
|
+
add: "after",
|
|
736
|
+
tokenize: tokenizePotentialGfmFootnoteCall,
|
|
737
|
+
resolveTo: resolveToPotentialGfmFootnoteCall
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* @this {TokenizeContext}
|
|
744
|
+
* @type {Tokenizer}
|
|
745
|
+
*/
|
|
746
|
+
function tokenizePotentialGfmFootnoteCall(effects, ok, nok) {
|
|
747
|
+
const self = this;
|
|
748
|
+
let index = self.events.length;
|
|
749
|
+
const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
|
|
750
|
+
/** @type {Token} */
|
|
751
|
+
let labelStart;
|
|
752
|
+
while (index--) {
|
|
753
|
+
const token = self.events[index][1];
|
|
754
|
+
if (token.type === "labelImage") {
|
|
755
|
+
labelStart = token;
|
|
756
|
+
break;
|
|
757
|
+
}
|
|
758
|
+
if (token.type === "gfmFootnoteCall" || token.type === "labelLink" || token.type === "label" || token.type === "image" || token.type === "link") break;
|
|
759
|
+
}
|
|
760
|
+
return start;
|
|
761
|
+
/**
|
|
762
|
+
* @type {State}
|
|
763
|
+
*/
|
|
764
|
+
function start(code) {
|
|
765
|
+
if (!labelStart || !labelStart._balanced) return nok(code);
|
|
766
|
+
const id = normalizeIdentifier(self.sliceSerialize({
|
|
767
|
+
start: labelStart.end,
|
|
768
|
+
end: self.now()
|
|
769
|
+
}));
|
|
770
|
+
if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) return nok(code);
|
|
771
|
+
effects.enter("gfmFootnoteCallLabelMarker");
|
|
772
|
+
effects.consume(code);
|
|
773
|
+
effects.exit("gfmFootnoteCallLabelMarker");
|
|
774
|
+
return ok(code);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
/** @type {Resolver} */
|
|
778
|
+
function resolveToPotentialGfmFootnoteCall(events, context) {
|
|
779
|
+
let index = events.length;
|
|
780
|
+
while (index--) if (events[index][1].type === "labelImage" && events[index][0] === "enter") {
|
|
781
|
+
events[index][1];
|
|
782
|
+
break;
|
|
783
|
+
}
|
|
784
|
+
events[index + 1][1].type = "data";
|
|
785
|
+
events[index + 3][1].type = "gfmFootnoteCallLabelMarker";
|
|
786
|
+
/** @type {Token} */
|
|
787
|
+
const call = {
|
|
788
|
+
type: "gfmFootnoteCall",
|
|
789
|
+
start: Object.assign({}, events[index + 3][1].start),
|
|
790
|
+
end: Object.assign({}, events[events.length - 1][1].end)
|
|
791
|
+
};
|
|
792
|
+
/** @type {Token} */
|
|
793
|
+
const marker = {
|
|
794
|
+
type: "gfmFootnoteCallMarker",
|
|
795
|
+
start: Object.assign({}, events[index + 3][1].end),
|
|
796
|
+
end: Object.assign({}, events[index + 3][1].end)
|
|
797
|
+
};
|
|
798
|
+
marker.end.column++;
|
|
799
|
+
marker.end.offset++;
|
|
800
|
+
marker.end._bufferIndex++;
|
|
801
|
+
/** @type {Token} */
|
|
802
|
+
const string = {
|
|
803
|
+
type: "gfmFootnoteCallString",
|
|
804
|
+
start: Object.assign({}, marker.end),
|
|
805
|
+
end: Object.assign({}, events[events.length - 1][1].start)
|
|
806
|
+
};
|
|
807
|
+
/** @type {Token} */
|
|
808
|
+
const chunk = {
|
|
809
|
+
type: "chunkString",
|
|
810
|
+
contentType: "string",
|
|
811
|
+
start: Object.assign({}, string.start),
|
|
812
|
+
end: Object.assign({}, string.end)
|
|
813
|
+
};
|
|
814
|
+
/** @type {Array<Event>} */
|
|
815
|
+
const replacement = [
|
|
816
|
+
events[index + 1],
|
|
817
|
+
events[index + 2],
|
|
818
|
+
[
|
|
819
|
+
"enter",
|
|
820
|
+
call,
|
|
821
|
+
context
|
|
822
|
+
],
|
|
823
|
+
events[index + 3],
|
|
824
|
+
events[index + 4],
|
|
825
|
+
[
|
|
826
|
+
"enter",
|
|
827
|
+
marker,
|
|
828
|
+
context
|
|
829
|
+
],
|
|
830
|
+
[
|
|
831
|
+
"exit",
|
|
832
|
+
marker,
|
|
833
|
+
context
|
|
834
|
+
],
|
|
835
|
+
[
|
|
836
|
+
"enter",
|
|
837
|
+
string,
|
|
838
|
+
context
|
|
839
|
+
],
|
|
840
|
+
[
|
|
841
|
+
"enter",
|
|
842
|
+
chunk,
|
|
843
|
+
context
|
|
844
|
+
],
|
|
845
|
+
[
|
|
846
|
+
"exit",
|
|
847
|
+
chunk,
|
|
848
|
+
context
|
|
849
|
+
],
|
|
850
|
+
[
|
|
851
|
+
"exit",
|
|
852
|
+
string,
|
|
853
|
+
context
|
|
854
|
+
],
|
|
855
|
+
events[events.length - 2],
|
|
856
|
+
events[events.length - 1],
|
|
857
|
+
[
|
|
858
|
+
"exit",
|
|
859
|
+
call,
|
|
860
|
+
context
|
|
861
|
+
]
|
|
862
|
+
];
|
|
863
|
+
events.splice(index, events.length - index + 1, ...replacement);
|
|
864
|
+
return events;
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* @this {TokenizeContext}
|
|
868
|
+
* @type {Tokenizer}
|
|
869
|
+
*/
|
|
870
|
+
function tokenizeGfmFootnoteCall(effects, ok, nok) {
|
|
871
|
+
const self = this;
|
|
872
|
+
const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
|
|
873
|
+
let size = 0;
|
|
874
|
+
/** @type {boolean} */
|
|
875
|
+
let data;
|
|
876
|
+
return start;
|
|
877
|
+
/**
|
|
878
|
+
* Start of footnote label.
|
|
879
|
+
*
|
|
880
|
+
* ```markdown
|
|
881
|
+
* > | a [^b] c
|
|
882
|
+
* ^
|
|
883
|
+
* ```
|
|
884
|
+
*
|
|
885
|
+
* @type {State}
|
|
886
|
+
*/
|
|
887
|
+
function start(code) {
|
|
888
|
+
effects.enter("gfmFootnoteCall");
|
|
889
|
+
effects.enter("gfmFootnoteCallLabelMarker");
|
|
890
|
+
effects.consume(code);
|
|
891
|
+
effects.exit("gfmFootnoteCallLabelMarker");
|
|
892
|
+
return callStart;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* After `[`, at `^`.
|
|
896
|
+
*
|
|
897
|
+
* ```markdown
|
|
898
|
+
* > | a [^b] c
|
|
899
|
+
* ^
|
|
900
|
+
* ```
|
|
901
|
+
*
|
|
902
|
+
* @type {State}
|
|
903
|
+
*/
|
|
904
|
+
function callStart(code) {
|
|
905
|
+
if (code !== 94) return nok(code);
|
|
906
|
+
effects.enter("gfmFootnoteCallMarker");
|
|
907
|
+
effects.consume(code);
|
|
908
|
+
effects.exit("gfmFootnoteCallMarker");
|
|
909
|
+
effects.enter("gfmFootnoteCallString");
|
|
910
|
+
effects.enter("chunkString").contentType = "string";
|
|
911
|
+
return callData;
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* In label.
|
|
915
|
+
*
|
|
916
|
+
* ```markdown
|
|
917
|
+
* > | a [^b] c
|
|
918
|
+
* ^
|
|
919
|
+
* ```
|
|
920
|
+
*
|
|
921
|
+
* @type {State}
|
|
922
|
+
*/
|
|
923
|
+
function callData(code) {
|
|
924
|
+
if (size > 999 || code === 93 && !data || code === null || code === 91 || markdownLineEndingOrSpace(code)) return nok(code);
|
|
925
|
+
if (code === 93) {
|
|
926
|
+
effects.exit("chunkString");
|
|
927
|
+
const token = effects.exit("gfmFootnoteCallString");
|
|
928
|
+
if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) return nok(code);
|
|
929
|
+
effects.enter("gfmFootnoteCallLabelMarker");
|
|
930
|
+
effects.consume(code);
|
|
931
|
+
effects.exit("gfmFootnoteCallLabelMarker");
|
|
932
|
+
effects.exit("gfmFootnoteCall");
|
|
933
|
+
return ok;
|
|
934
|
+
}
|
|
935
|
+
if (!markdownLineEndingOrSpace(code)) data = true;
|
|
936
|
+
size++;
|
|
937
|
+
effects.consume(code);
|
|
938
|
+
return code === 92 ? callEscape : callData;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* On character after escape.
|
|
942
|
+
*
|
|
943
|
+
* ```markdown
|
|
944
|
+
* > | a [^b\c] d
|
|
945
|
+
* ^
|
|
946
|
+
* ```
|
|
947
|
+
*
|
|
948
|
+
* @type {State}
|
|
949
|
+
*/
|
|
950
|
+
function callEscape(code) {
|
|
951
|
+
if (code === 91 || code === 92 || code === 93) {
|
|
952
|
+
effects.consume(code);
|
|
953
|
+
size++;
|
|
954
|
+
return callData;
|
|
955
|
+
}
|
|
956
|
+
return callData(code);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* @this {TokenizeContext}
|
|
961
|
+
* @type {Tokenizer}
|
|
962
|
+
*/
|
|
963
|
+
function tokenizeDefinitionStart(effects, ok, nok) {
|
|
964
|
+
const self = this;
|
|
965
|
+
const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
|
|
966
|
+
/** @type {string} */
|
|
967
|
+
let identifier;
|
|
968
|
+
let size = 0;
|
|
969
|
+
/** @type {boolean | undefined} */
|
|
970
|
+
let data;
|
|
971
|
+
return start;
|
|
972
|
+
/**
|
|
973
|
+
* Start of GFM footnote definition.
|
|
974
|
+
*
|
|
975
|
+
* ```markdown
|
|
976
|
+
* > | [^a]: b
|
|
977
|
+
* ^
|
|
978
|
+
* ```
|
|
979
|
+
*
|
|
980
|
+
* @type {State}
|
|
981
|
+
*/
|
|
982
|
+
function start(code) {
|
|
983
|
+
effects.enter("gfmFootnoteDefinition")._container = true;
|
|
984
|
+
effects.enter("gfmFootnoteDefinitionLabel");
|
|
985
|
+
effects.enter("gfmFootnoteDefinitionLabelMarker");
|
|
986
|
+
effects.consume(code);
|
|
987
|
+
effects.exit("gfmFootnoteDefinitionLabelMarker");
|
|
988
|
+
return labelAtMarker;
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* In label, at caret.
|
|
992
|
+
*
|
|
993
|
+
* ```markdown
|
|
994
|
+
* > | [^a]: b
|
|
995
|
+
* ^
|
|
996
|
+
* ```
|
|
997
|
+
*
|
|
998
|
+
* @type {State}
|
|
999
|
+
*/
|
|
1000
|
+
function labelAtMarker(code) {
|
|
1001
|
+
if (code === 94) {
|
|
1002
|
+
effects.enter("gfmFootnoteDefinitionMarker");
|
|
1003
|
+
effects.consume(code);
|
|
1004
|
+
effects.exit("gfmFootnoteDefinitionMarker");
|
|
1005
|
+
effects.enter("gfmFootnoteDefinitionLabelString");
|
|
1006
|
+
effects.enter("chunkString").contentType = "string";
|
|
1007
|
+
return labelInside;
|
|
1008
|
+
}
|
|
1009
|
+
return nok(code);
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* In label.
|
|
1013
|
+
*
|
|
1014
|
+
* > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote
|
|
1015
|
+
* > definition labels.
|
|
1016
|
+
*
|
|
1017
|
+
* ```markdown
|
|
1018
|
+
* > | [^a]: b
|
|
1019
|
+
* ^
|
|
1020
|
+
* ```
|
|
1021
|
+
*
|
|
1022
|
+
* @type {State}
|
|
1023
|
+
*/
|
|
1024
|
+
function labelInside(code) {
|
|
1025
|
+
if (size > 999 || code === 93 && !data || code === null || code === 91 || markdownLineEndingOrSpace(code)) return nok(code);
|
|
1026
|
+
if (code === 93) {
|
|
1027
|
+
effects.exit("chunkString");
|
|
1028
|
+
const token = effects.exit("gfmFootnoteDefinitionLabelString");
|
|
1029
|
+
identifier = normalizeIdentifier(self.sliceSerialize(token));
|
|
1030
|
+
effects.enter("gfmFootnoteDefinitionLabelMarker");
|
|
1031
|
+
effects.consume(code);
|
|
1032
|
+
effects.exit("gfmFootnoteDefinitionLabelMarker");
|
|
1033
|
+
effects.exit("gfmFootnoteDefinitionLabel");
|
|
1034
|
+
return labelAfter;
|
|
1035
|
+
}
|
|
1036
|
+
if (!markdownLineEndingOrSpace(code)) data = true;
|
|
1037
|
+
size++;
|
|
1038
|
+
effects.consume(code);
|
|
1039
|
+
return code === 92 ? labelEscape : labelInside;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* After `\`, at a special character.
|
|
1043
|
+
*
|
|
1044
|
+
* > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets:
|
|
1045
|
+
* > <https://github.com/github/cmark-gfm/issues/240>
|
|
1046
|
+
*
|
|
1047
|
+
* ```markdown
|
|
1048
|
+
* > | [^a\*b]: c
|
|
1049
|
+
* ^
|
|
1050
|
+
* ```
|
|
1051
|
+
*
|
|
1052
|
+
* @type {State}
|
|
1053
|
+
*/
|
|
1054
|
+
function labelEscape(code) {
|
|
1055
|
+
if (code === 91 || code === 92 || code === 93) {
|
|
1056
|
+
effects.consume(code);
|
|
1057
|
+
size++;
|
|
1058
|
+
return labelInside;
|
|
1059
|
+
}
|
|
1060
|
+
return labelInside(code);
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* After definition label.
|
|
1064
|
+
*
|
|
1065
|
+
* ```markdown
|
|
1066
|
+
* > | [^a]: b
|
|
1067
|
+
* ^
|
|
1068
|
+
* ```
|
|
1069
|
+
*
|
|
1070
|
+
* @type {State}
|
|
1071
|
+
*/
|
|
1072
|
+
function labelAfter(code) {
|
|
1073
|
+
if (code === 58) {
|
|
1074
|
+
effects.enter("definitionMarker");
|
|
1075
|
+
effects.consume(code);
|
|
1076
|
+
effects.exit("definitionMarker");
|
|
1077
|
+
if (!defined.includes(identifier)) defined.push(identifier);
|
|
1078
|
+
return factorySpace(effects, whitespaceAfter, "gfmFootnoteDefinitionWhitespace");
|
|
1079
|
+
}
|
|
1080
|
+
return nok(code);
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* After definition prefix.
|
|
1084
|
+
*
|
|
1085
|
+
* ```markdown
|
|
1086
|
+
* > | [^a]: b
|
|
1087
|
+
* ^
|
|
1088
|
+
* ```
|
|
1089
|
+
*
|
|
1090
|
+
* @type {State}
|
|
1091
|
+
*/
|
|
1092
|
+
function whitespaceAfter(code) {
|
|
1093
|
+
return ok(code);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* @this {TokenizeContext}
|
|
1098
|
+
* @type {Tokenizer}
|
|
1099
|
+
*/
|
|
1100
|
+
function tokenizeDefinitionContinuation(effects, ok, nok) {
|
|
1101
|
+
return effects.check(blankLine, ok, effects.attempt(indent, ok, nok));
|
|
1102
|
+
}
|
|
1103
|
+
/** @type {Exiter} */
|
|
1104
|
+
function gfmFootnoteDefinitionEnd(effects) {
|
|
1105
|
+
effects.exit("gfmFootnoteDefinition");
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* @this {TokenizeContext}
|
|
1109
|
+
* @type {Tokenizer}
|
|
1110
|
+
*/
|
|
1111
|
+
function tokenizeIndent(effects, ok, nok) {
|
|
1112
|
+
const self = this;
|
|
1113
|
+
return factorySpace(effects, afterPrefix, "gfmFootnoteDefinitionIndent", 5);
|
|
1114
|
+
/**
|
|
1115
|
+
* @type {State}
|
|
1116
|
+
*/
|
|
1117
|
+
function afterPrefix(code) {
|
|
1118
|
+
const tail = self.events[self.events.length - 1];
|
|
1119
|
+
return tail && tail[1].type === "gfmFootnoteDefinitionIndent" && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok(code) : nok(code);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
//#endregion
|
|
1123
|
+
//#region ../../node_modules/.pnpm/micromark-extension-gfm-strikethrough@2.1.0/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
|
|
1124
|
+
/**
|
|
1125
|
+
* @import {Options} from 'micromark-extension-gfm-strikethrough'
|
|
1126
|
+
* @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
|
|
1127
|
+
*/
|
|
1128
|
+
/**
|
|
1129
|
+
* Create an extension for `micromark` to enable GFM strikethrough syntax.
|
|
1130
|
+
*
|
|
1131
|
+
* @param {Options | null | undefined} [options={}]
|
|
1132
|
+
* Configuration.
|
|
1133
|
+
* @returns {Extension}
|
|
1134
|
+
* Extension for `micromark` that can be passed in `extensions`, to
|
|
1135
|
+
* enable GFM strikethrough syntax.
|
|
1136
|
+
*/
|
|
1137
|
+
function gfmStrikethrough(options) {
|
|
1138
|
+
let single = (options || {}).singleTilde;
|
|
1139
|
+
const tokenizer = {
|
|
1140
|
+
name: "strikethrough",
|
|
1141
|
+
tokenize: tokenizeStrikethrough,
|
|
1142
|
+
resolveAll: resolveAllStrikethrough
|
|
1143
|
+
};
|
|
1144
|
+
if (single === null || single === void 0) single = true;
|
|
1145
|
+
return {
|
|
1146
|
+
text: { [126]: tokenizer },
|
|
1147
|
+
insideSpan: { null: [tokenizer] },
|
|
1148
|
+
attentionMarkers: { null: [126] }
|
|
1149
|
+
};
|
|
1150
|
+
/**
|
|
1151
|
+
* Take events and resolve strikethrough.
|
|
1152
|
+
*
|
|
1153
|
+
* @type {Resolver}
|
|
1154
|
+
*/
|
|
1155
|
+
function resolveAllStrikethrough(events, context) {
|
|
1156
|
+
let index = -1;
|
|
1157
|
+
while (++index < events.length) if (events[index][0] === "enter" && events[index][1].type === "strikethroughSequenceTemporary" && events[index][1]._close) {
|
|
1158
|
+
let open = index;
|
|
1159
|
+
while (open--) if (events[open][0] === "exit" && events[open][1].type === "strikethroughSequenceTemporary" && events[open][1]._open && events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {
|
|
1160
|
+
events[index][1].type = "strikethroughSequence";
|
|
1161
|
+
events[open][1].type = "strikethroughSequence";
|
|
1162
|
+
/** @type {Token} */
|
|
1163
|
+
const strikethrough = {
|
|
1164
|
+
type: "strikethrough",
|
|
1165
|
+
start: Object.assign({}, events[open][1].start),
|
|
1166
|
+
end: Object.assign({}, events[index][1].end)
|
|
1167
|
+
};
|
|
1168
|
+
/** @type {Token} */
|
|
1169
|
+
const text = {
|
|
1170
|
+
type: "strikethroughText",
|
|
1171
|
+
start: Object.assign({}, events[open][1].end),
|
|
1172
|
+
end: Object.assign({}, events[index][1].start)
|
|
1173
|
+
};
|
|
1174
|
+
/** @type {Array<Event>} */
|
|
1175
|
+
const nextEvents = [
|
|
1176
|
+
[
|
|
1177
|
+
"enter",
|
|
1178
|
+
strikethrough,
|
|
1179
|
+
context
|
|
1180
|
+
],
|
|
1181
|
+
[
|
|
1182
|
+
"enter",
|
|
1183
|
+
events[open][1],
|
|
1184
|
+
context
|
|
1185
|
+
],
|
|
1186
|
+
[
|
|
1187
|
+
"exit",
|
|
1188
|
+
events[open][1],
|
|
1189
|
+
context
|
|
1190
|
+
],
|
|
1191
|
+
[
|
|
1192
|
+
"enter",
|
|
1193
|
+
text,
|
|
1194
|
+
context
|
|
1195
|
+
]
|
|
1196
|
+
];
|
|
1197
|
+
const insideSpan = context.parser.constructs.insideSpan.null;
|
|
1198
|
+
if (insideSpan) splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));
|
|
1199
|
+
splice(nextEvents, nextEvents.length, 0, [
|
|
1200
|
+
[
|
|
1201
|
+
"exit",
|
|
1202
|
+
text,
|
|
1203
|
+
context
|
|
1204
|
+
],
|
|
1205
|
+
[
|
|
1206
|
+
"enter",
|
|
1207
|
+
events[index][1],
|
|
1208
|
+
context
|
|
1209
|
+
],
|
|
1210
|
+
[
|
|
1211
|
+
"exit",
|
|
1212
|
+
events[index][1],
|
|
1213
|
+
context
|
|
1214
|
+
],
|
|
1215
|
+
[
|
|
1216
|
+
"exit",
|
|
1217
|
+
strikethrough,
|
|
1218
|
+
context
|
|
1219
|
+
]
|
|
1220
|
+
]);
|
|
1221
|
+
splice(events, open - 1, index - open + 3, nextEvents);
|
|
1222
|
+
index = open + nextEvents.length - 2;
|
|
1223
|
+
break;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
index = -1;
|
|
1227
|
+
while (++index < events.length) if (events[index][1].type === "strikethroughSequenceTemporary") events[index][1].type = "data";
|
|
1228
|
+
return events;
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* @this {TokenizeContext}
|
|
1232
|
+
* @type {Tokenizer}
|
|
1233
|
+
*/
|
|
1234
|
+
function tokenizeStrikethrough(effects, ok, nok) {
|
|
1235
|
+
const previous = this.previous;
|
|
1236
|
+
const events = this.events;
|
|
1237
|
+
let size = 0;
|
|
1238
|
+
return start;
|
|
1239
|
+
/** @type {State} */
|
|
1240
|
+
function start(code) {
|
|
1241
|
+
if (previous === 126 && events[events.length - 1][1].type !== "characterEscape") return nok(code);
|
|
1242
|
+
effects.enter("strikethroughSequenceTemporary");
|
|
1243
|
+
return more(code);
|
|
1244
|
+
}
|
|
1245
|
+
/** @type {State} */
|
|
1246
|
+
function more(code) {
|
|
1247
|
+
const before = classifyCharacter(previous);
|
|
1248
|
+
if (code === 126) {
|
|
1249
|
+
if (size > 1) return nok(code);
|
|
1250
|
+
effects.consume(code);
|
|
1251
|
+
size++;
|
|
1252
|
+
return more;
|
|
1253
|
+
}
|
|
1254
|
+
if (size < 2 && !single) return nok(code);
|
|
1255
|
+
const token = effects.exit("strikethroughSequenceTemporary");
|
|
1256
|
+
const after = classifyCharacter(code);
|
|
1257
|
+
token._open = !after || after === 2 && Boolean(before);
|
|
1258
|
+
token._close = !before || before === 2 && Boolean(after);
|
|
1259
|
+
return ok(code);
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
//#endregion
|
|
1264
|
+
//#region ../../node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/edit-map.js
|
|
1265
|
+
/**
|
|
1266
|
+
* @import {Event} from 'micromark-util-types'
|
|
1267
|
+
*/
|
|
1268
|
+
/**
|
|
1269
|
+
* @typedef {[number, number, Array<Event>]} Change
|
|
1270
|
+
* @typedef {[number, number, number]} Jump
|
|
1271
|
+
*/
|
|
1272
|
+
/**
|
|
1273
|
+
* Tracks a bunch of edits.
|
|
1274
|
+
*/
|
|
1275
|
+
var EditMap = class {
|
|
1276
|
+
/**
|
|
1277
|
+
* Create a new edit map.
|
|
1278
|
+
*/
|
|
1279
|
+
constructor() {
|
|
1280
|
+
/**
|
|
1281
|
+
* Record of changes.
|
|
1282
|
+
*
|
|
1283
|
+
* @type {Array<Change>}
|
|
1284
|
+
*/
|
|
1285
|
+
this.map = [];
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* Create an edit: a remove and/or add at a certain place.
|
|
1289
|
+
*
|
|
1290
|
+
* @param {number} index
|
|
1291
|
+
* @param {number} remove
|
|
1292
|
+
* @param {Array<Event>} add
|
|
1293
|
+
* @returns {undefined}
|
|
1294
|
+
*/
|
|
1295
|
+
add(index, remove, add) {
|
|
1296
|
+
addImplementation(this, index, remove, add);
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Done, change the events.
|
|
1300
|
+
*
|
|
1301
|
+
* @param {Array<Event>} events
|
|
1302
|
+
* @returns {undefined}
|
|
1303
|
+
*/
|
|
1304
|
+
consume(events) {
|
|
1305
|
+
this.map.sort(function(a, b) {
|
|
1306
|
+
return a[0] - b[0];
|
|
1307
|
+
});
|
|
1308
|
+
/* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */
|
|
1309
|
+
if (this.map.length === 0) return;
|
|
1310
|
+
let index = this.map.length;
|
|
1311
|
+
/** @type {Array<Array<Event>>} */
|
|
1312
|
+
const vecs = [];
|
|
1313
|
+
while (index > 0) {
|
|
1314
|
+
index -= 1;
|
|
1315
|
+
vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);
|
|
1316
|
+
events.length = this.map[index][0];
|
|
1317
|
+
}
|
|
1318
|
+
vecs.push(events.slice());
|
|
1319
|
+
events.length = 0;
|
|
1320
|
+
let slice = vecs.pop();
|
|
1321
|
+
while (slice) {
|
|
1322
|
+
for (const element of slice) events.push(element);
|
|
1323
|
+
slice = vecs.pop();
|
|
1324
|
+
}
|
|
1325
|
+
this.map.length = 0;
|
|
1326
|
+
}
|
|
1327
|
+
};
|
|
1328
|
+
/**
|
|
1329
|
+
* Create an edit.
|
|
1330
|
+
*
|
|
1331
|
+
* @param {EditMap} editMap
|
|
1332
|
+
* @param {number} at
|
|
1333
|
+
* @param {number} remove
|
|
1334
|
+
* @param {Array<Event>} add
|
|
1335
|
+
* @returns {undefined}
|
|
1336
|
+
*/
|
|
1337
|
+
function addImplementation(editMap, at, remove, add) {
|
|
1338
|
+
let index = 0;
|
|
1339
|
+
/* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */
|
|
1340
|
+
if (remove === 0 && add.length === 0) return;
|
|
1341
|
+
while (index < editMap.map.length) {
|
|
1342
|
+
if (editMap.map[index][0] === at) {
|
|
1343
|
+
editMap.map[index][1] += remove;
|
|
1344
|
+
editMap.map[index][2].push(...add);
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
index += 1;
|
|
1348
|
+
}
|
|
1349
|
+
editMap.map.push([
|
|
1350
|
+
at,
|
|
1351
|
+
remove,
|
|
1352
|
+
add
|
|
1353
|
+
]);
|
|
1354
|
+
}
|
|
1355
|
+
//#endregion
|
|
1356
|
+
//#region ../../node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/infer.js
|
|
1357
|
+
/**
|
|
1358
|
+
* @import {Event} from 'micromark-util-types'
|
|
1359
|
+
*/
|
|
1360
|
+
/**
|
|
1361
|
+
* @typedef {'center' | 'left' | 'none' | 'right'} Align
|
|
1362
|
+
*/
|
|
1363
|
+
/**
|
|
1364
|
+
* Figure out the alignment of a GFM table.
|
|
1365
|
+
*
|
|
1366
|
+
* @param {Readonly<Array<Event>>} events
|
|
1367
|
+
* List of events.
|
|
1368
|
+
* @param {number} index
|
|
1369
|
+
* Table enter event.
|
|
1370
|
+
* @returns {Array<Align>}
|
|
1371
|
+
* List of aligns.
|
|
1372
|
+
*/
|
|
1373
|
+
function gfmTableAlign(events, index) {
|
|
1374
|
+
let inDelimiterRow = false;
|
|
1375
|
+
/** @type {Array<Align>} */
|
|
1376
|
+
const align = [];
|
|
1377
|
+
while (index < events.length) {
|
|
1378
|
+
const event = events[index];
|
|
1379
|
+
if (inDelimiterRow) {
|
|
1380
|
+
if (event[0] === "enter") {
|
|
1381
|
+
if (event[1].type === "tableContent") align.push(events[index + 1][1].type === "tableDelimiterMarker" ? "left" : "none");
|
|
1382
|
+
} else if (event[1].type === "tableContent") {
|
|
1383
|
+
if (events[index - 1][1].type === "tableDelimiterMarker") {
|
|
1384
|
+
const alignIndex = align.length - 1;
|
|
1385
|
+
align[alignIndex] = align[alignIndex] === "left" ? "center" : "right";
|
|
1386
|
+
}
|
|
1387
|
+
} else if (event[1].type === "tableDelimiterRow") break;
|
|
1388
|
+
} else if (event[0] === "enter" && event[1].type === "tableDelimiterRow") inDelimiterRow = true;
|
|
1389
|
+
index += 1;
|
|
1390
|
+
}
|
|
1391
|
+
return align;
|
|
1392
|
+
}
|
|
1393
|
+
//#endregion
|
|
1394
|
+
//#region ../../node_modules/.pnpm/micromark-extension-gfm-table@2.1.1/node_modules/micromark-extension-gfm-table/lib/syntax.js
|
|
1395
|
+
/**
|
|
1396
|
+
* @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
|
|
1397
|
+
*/
|
|
1398
|
+
/**
|
|
1399
|
+
* @typedef {[number, number, number, number]} Range
|
|
1400
|
+
* Cell info.
|
|
1401
|
+
*
|
|
1402
|
+
* @typedef {0 | 1 | 2 | 3} RowKind
|
|
1403
|
+
* Where we are: `1` for head row, `2` for delimiter row, `3` for body row.
|
|
1404
|
+
*/
|
|
1405
|
+
/**
|
|
1406
|
+
* Create an HTML extension for `micromark` to support GitHub tables syntax.
|
|
1407
|
+
*
|
|
1408
|
+
* @returns {Extension}
|
|
1409
|
+
* Extension for `micromark` that can be passed in `extensions` to enable GFM
|
|
1410
|
+
* table syntax.
|
|
1411
|
+
*/
|
|
1412
|
+
function gfmTable() {
|
|
1413
|
+
return { flow: { null: {
|
|
1414
|
+
name: "table",
|
|
1415
|
+
tokenize: tokenizeTable,
|
|
1416
|
+
resolveAll: resolveTable
|
|
1417
|
+
} } };
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* @this {TokenizeContext}
|
|
1421
|
+
* @type {Tokenizer}
|
|
1422
|
+
*/
|
|
1423
|
+
function tokenizeTable(effects, ok, nok) {
|
|
1424
|
+
const self = this;
|
|
1425
|
+
let size = 0;
|
|
1426
|
+
let sizeB = 0;
|
|
1427
|
+
/** @type {boolean | undefined} */
|
|
1428
|
+
let seen;
|
|
1429
|
+
return start;
|
|
1430
|
+
/**
|
|
1431
|
+
* Start of a GFM table.
|
|
1432
|
+
*
|
|
1433
|
+
* If there is a valid table row or table head before, then we try to parse
|
|
1434
|
+
* another row.
|
|
1435
|
+
* Otherwise, we try to parse a head.
|
|
1436
|
+
*
|
|
1437
|
+
* ```markdown
|
|
1438
|
+
* > | | a |
|
|
1439
|
+
* ^
|
|
1440
|
+
* | | - |
|
|
1441
|
+
* > | | b |
|
|
1442
|
+
* ^
|
|
1443
|
+
* ```
|
|
1444
|
+
* @type {State}
|
|
1445
|
+
*/
|
|
1446
|
+
function start(code) {
|
|
1447
|
+
let index = self.events.length - 1;
|
|
1448
|
+
while (index > -1) {
|
|
1449
|
+
const type = self.events[index][1].type;
|
|
1450
|
+
if (type === "lineEnding" || type === "linePrefix") index--;
|
|
1451
|
+
else break;
|
|
1452
|
+
}
|
|
1453
|
+
const tail = index > -1 ? self.events[index][1].type : null;
|
|
1454
|
+
const next = tail === "tableHead" || tail === "tableRow" ? bodyRowStart : headRowBefore;
|
|
1455
|
+
if (next === bodyRowStart && self.parser.lazy[self.now().line]) return nok(code);
|
|
1456
|
+
return next(code);
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* Before table head row.
|
|
1460
|
+
*
|
|
1461
|
+
* ```markdown
|
|
1462
|
+
* > | | a |
|
|
1463
|
+
* ^
|
|
1464
|
+
* | | - |
|
|
1465
|
+
* | | b |
|
|
1466
|
+
* ```
|
|
1467
|
+
*
|
|
1468
|
+
* @type {State}
|
|
1469
|
+
*/
|
|
1470
|
+
function headRowBefore(code) {
|
|
1471
|
+
effects.enter("tableHead");
|
|
1472
|
+
effects.enter("tableRow");
|
|
1473
|
+
return headRowStart(code);
|
|
1474
|
+
}
|
|
1475
|
+
/**
|
|
1476
|
+
* Before table head row, after whitespace.
|
|
1477
|
+
*
|
|
1478
|
+
* ```markdown
|
|
1479
|
+
* > | | a |
|
|
1480
|
+
* ^
|
|
1481
|
+
* | | - |
|
|
1482
|
+
* | | b |
|
|
1483
|
+
* ```
|
|
1484
|
+
*
|
|
1485
|
+
* @type {State}
|
|
1486
|
+
*/
|
|
1487
|
+
function headRowStart(code) {
|
|
1488
|
+
if (code === 124) return headRowBreak(code);
|
|
1489
|
+
seen = true;
|
|
1490
|
+
sizeB += 1;
|
|
1491
|
+
return headRowBreak(code);
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* At break in table head row.
|
|
1495
|
+
*
|
|
1496
|
+
* ```markdown
|
|
1497
|
+
* > | | a |
|
|
1498
|
+
* ^
|
|
1499
|
+
* ^
|
|
1500
|
+
* ^
|
|
1501
|
+
* | | - |
|
|
1502
|
+
* | | b |
|
|
1503
|
+
* ```
|
|
1504
|
+
*
|
|
1505
|
+
* @type {State}
|
|
1506
|
+
*/
|
|
1507
|
+
function headRowBreak(code) {
|
|
1508
|
+
if (code === null) return nok(code);
|
|
1509
|
+
if (markdownLineEnding(code)) {
|
|
1510
|
+
if (sizeB > 1) {
|
|
1511
|
+
sizeB = 0;
|
|
1512
|
+
self.interrupt = true;
|
|
1513
|
+
effects.exit("tableRow");
|
|
1514
|
+
effects.enter("lineEnding");
|
|
1515
|
+
effects.consume(code);
|
|
1516
|
+
effects.exit("lineEnding");
|
|
1517
|
+
return headDelimiterStart;
|
|
1518
|
+
}
|
|
1519
|
+
return nok(code);
|
|
1520
|
+
}
|
|
1521
|
+
if (markdownSpace(code)) return factorySpace(effects, headRowBreak, "whitespace")(code);
|
|
1522
|
+
sizeB += 1;
|
|
1523
|
+
if (seen) {
|
|
1524
|
+
seen = false;
|
|
1525
|
+
size += 1;
|
|
1526
|
+
}
|
|
1527
|
+
if (code === 124) {
|
|
1528
|
+
effects.enter("tableCellDivider");
|
|
1529
|
+
effects.consume(code);
|
|
1530
|
+
effects.exit("tableCellDivider");
|
|
1531
|
+
seen = true;
|
|
1532
|
+
return headRowBreak;
|
|
1533
|
+
}
|
|
1534
|
+
effects.enter("data");
|
|
1535
|
+
return headRowData(code);
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* In table head row data.
|
|
1539
|
+
*
|
|
1540
|
+
* ```markdown
|
|
1541
|
+
* > | | a |
|
|
1542
|
+
* ^
|
|
1543
|
+
* | | - |
|
|
1544
|
+
* | | b |
|
|
1545
|
+
* ```
|
|
1546
|
+
*
|
|
1547
|
+
* @type {State}
|
|
1548
|
+
*/
|
|
1549
|
+
function headRowData(code) {
|
|
1550
|
+
if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {
|
|
1551
|
+
effects.exit("data");
|
|
1552
|
+
return headRowBreak(code);
|
|
1553
|
+
}
|
|
1554
|
+
effects.consume(code);
|
|
1555
|
+
return code === 92 ? headRowEscape : headRowData;
|
|
1556
|
+
}
|
|
1557
|
+
/**
|
|
1558
|
+
* In table head row escape.
|
|
1559
|
+
*
|
|
1560
|
+
* ```markdown
|
|
1561
|
+
* > | | a\-b |
|
|
1562
|
+
* ^
|
|
1563
|
+
* | | ---- |
|
|
1564
|
+
* | | c |
|
|
1565
|
+
* ```
|
|
1566
|
+
*
|
|
1567
|
+
* @type {State}
|
|
1568
|
+
*/
|
|
1569
|
+
function headRowEscape(code) {
|
|
1570
|
+
if (code === 92 || code === 124) {
|
|
1571
|
+
effects.consume(code);
|
|
1572
|
+
return headRowData;
|
|
1573
|
+
}
|
|
1574
|
+
return headRowData(code);
|
|
1575
|
+
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Before delimiter row.
|
|
1578
|
+
*
|
|
1579
|
+
* ```markdown
|
|
1580
|
+
* | | a |
|
|
1581
|
+
* > | | - |
|
|
1582
|
+
* ^
|
|
1583
|
+
* | | b |
|
|
1584
|
+
* ```
|
|
1585
|
+
*
|
|
1586
|
+
* @type {State}
|
|
1587
|
+
*/
|
|
1588
|
+
function headDelimiterStart(code) {
|
|
1589
|
+
self.interrupt = false;
|
|
1590
|
+
if (self.parser.lazy[self.now().line]) return nok(code);
|
|
1591
|
+
effects.enter("tableDelimiterRow");
|
|
1592
|
+
seen = false;
|
|
1593
|
+
if (markdownSpace(code)) return factorySpace(effects, headDelimiterBefore, "linePrefix", self.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(code);
|
|
1594
|
+
return headDelimiterBefore(code);
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* Before delimiter row, after optional whitespace.
|
|
1598
|
+
*
|
|
1599
|
+
* Reused when a `|` is found later, to parse another cell.
|
|
1600
|
+
*
|
|
1601
|
+
* ```markdown
|
|
1602
|
+
* | | a |
|
|
1603
|
+
* > | | - |
|
|
1604
|
+
* ^
|
|
1605
|
+
* | | b |
|
|
1606
|
+
* ```
|
|
1607
|
+
*
|
|
1608
|
+
* @type {State}
|
|
1609
|
+
*/
|
|
1610
|
+
function headDelimiterBefore(code) {
|
|
1611
|
+
if (code === 45 || code === 58) return headDelimiterValueBefore(code);
|
|
1612
|
+
if (code === 124) {
|
|
1613
|
+
seen = true;
|
|
1614
|
+
effects.enter("tableCellDivider");
|
|
1615
|
+
effects.consume(code);
|
|
1616
|
+
effects.exit("tableCellDivider");
|
|
1617
|
+
return headDelimiterCellBefore;
|
|
1618
|
+
}
|
|
1619
|
+
return headDelimiterNok(code);
|
|
1620
|
+
}
|
|
1621
|
+
/**
|
|
1622
|
+
* After `|`, before delimiter cell.
|
|
1623
|
+
*
|
|
1624
|
+
* ```markdown
|
|
1625
|
+
* | | a |
|
|
1626
|
+
* > | | - |
|
|
1627
|
+
* ^
|
|
1628
|
+
* ```
|
|
1629
|
+
*
|
|
1630
|
+
* @type {State}
|
|
1631
|
+
*/
|
|
1632
|
+
function headDelimiterCellBefore(code) {
|
|
1633
|
+
if (markdownSpace(code)) return factorySpace(effects, headDelimiterValueBefore, "whitespace")(code);
|
|
1634
|
+
return headDelimiterValueBefore(code);
|
|
1635
|
+
}
|
|
1636
|
+
/**
|
|
1637
|
+
* Before delimiter cell value.
|
|
1638
|
+
*
|
|
1639
|
+
* ```markdown
|
|
1640
|
+
* | | a |
|
|
1641
|
+
* > | | - |
|
|
1642
|
+
* ^
|
|
1643
|
+
* ```
|
|
1644
|
+
*
|
|
1645
|
+
* @type {State}
|
|
1646
|
+
*/
|
|
1647
|
+
function headDelimiterValueBefore(code) {
|
|
1648
|
+
if (code === 58) {
|
|
1649
|
+
sizeB += 1;
|
|
1650
|
+
seen = true;
|
|
1651
|
+
effects.enter("tableDelimiterMarker");
|
|
1652
|
+
effects.consume(code);
|
|
1653
|
+
effects.exit("tableDelimiterMarker");
|
|
1654
|
+
return headDelimiterLeftAlignmentAfter;
|
|
1655
|
+
}
|
|
1656
|
+
if (code === 45) {
|
|
1657
|
+
sizeB += 1;
|
|
1658
|
+
return headDelimiterLeftAlignmentAfter(code);
|
|
1659
|
+
}
|
|
1660
|
+
if (code === null || markdownLineEnding(code)) return headDelimiterCellAfter(code);
|
|
1661
|
+
return headDelimiterNok(code);
|
|
1662
|
+
}
|
|
1663
|
+
/**
|
|
1664
|
+
* After delimiter cell left alignment marker.
|
|
1665
|
+
*
|
|
1666
|
+
* ```markdown
|
|
1667
|
+
* | | a |
|
|
1668
|
+
* > | | :- |
|
|
1669
|
+
* ^
|
|
1670
|
+
* ```
|
|
1671
|
+
*
|
|
1672
|
+
* @type {State}
|
|
1673
|
+
*/
|
|
1674
|
+
function headDelimiterLeftAlignmentAfter(code) {
|
|
1675
|
+
if (code === 45) {
|
|
1676
|
+
effects.enter("tableDelimiterFiller");
|
|
1677
|
+
return headDelimiterFiller(code);
|
|
1678
|
+
}
|
|
1679
|
+
return headDelimiterNok(code);
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* In delimiter cell filler.
|
|
1683
|
+
*
|
|
1684
|
+
* ```markdown
|
|
1685
|
+
* | | a |
|
|
1686
|
+
* > | | - |
|
|
1687
|
+
* ^
|
|
1688
|
+
* ```
|
|
1689
|
+
*
|
|
1690
|
+
* @type {State}
|
|
1691
|
+
*/
|
|
1692
|
+
function headDelimiterFiller(code) {
|
|
1693
|
+
if (code === 45) {
|
|
1694
|
+
effects.consume(code);
|
|
1695
|
+
return headDelimiterFiller;
|
|
1696
|
+
}
|
|
1697
|
+
if (code === 58) {
|
|
1698
|
+
seen = true;
|
|
1699
|
+
effects.exit("tableDelimiterFiller");
|
|
1700
|
+
effects.enter("tableDelimiterMarker");
|
|
1701
|
+
effects.consume(code);
|
|
1702
|
+
effects.exit("tableDelimiterMarker");
|
|
1703
|
+
return headDelimiterRightAlignmentAfter;
|
|
1704
|
+
}
|
|
1705
|
+
effects.exit("tableDelimiterFiller");
|
|
1706
|
+
return headDelimiterRightAlignmentAfter(code);
|
|
1707
|
+
}
|
|
1708
|
+
/**
|
|
1709
|
+
* After delimiter cell right alignment marker.
|
|
1710
|
+
*
|
|
1711
|
+
* ```markdown
|
|
1712
|
+
* | | a |
|
|
1713
|
+
* > | | -: |
|
|
1714
|
+
* ^
|
|
1715
|
+
* ```
|
|
1716
|
+
*
|
|
1717
|
+
* @type {State}
|
|
1718
|
+
*/
|
|
1719
|
+
function headDelimiterRightAlignmentAfter(code) {
|
|
1720
|
+
if (markdownSpace(code)) return factorySpace(effects, headDelimiterCellAfter, "whitespace")(code);
|
|
1721
|
+
return headDelimiterCellAfter(code);
|
|
1722
|
+
}
|
|
1723
|
+
/**
|
|
1724
|
+
* After delimiter cell.
|
|
1725
|
+
*
|
|
1726
|
+
* ```markdown
|
|
1727
|
+
* | | a |
|
|
1728
|
+
* > | | -: |
|
|
1729
|
+
* ^
|
|
1730
|
+
* ```
|
|
1731
|
+
*
|
|
1732
|
+
* @type {State}
|
|
1733
|
+
*/
|
|
1734
|
+
function headDelimiterCellAfter(code) {
|
|
1735
|
+
if (code === 124) return headDelimiterBefore(code);
|
|
1736
|
+
if (code === null || markdownLineEnding(code)) {
|
|
1737
|
+
if (!seen || size !== sizeB) return headDelimiterNok(code);
|
|
1738
|
+
effects.exit("tableDelimiterRow");
|
|
1739
|
+
effects.exit("tableHead");
|
|
1740
|
+
return ok(code);
|
|
1741
|
+
}
|
|
1742
|
+
return headDelimiterNok(code);
|
|
1743
|
+
}
|
|
1744
|
+
/**
|
|
1745
|
+
* In delimiter row, at a disallowed byte.
|
|
1746
|
+
*
|
|
1747
|
+
* ```markdown
|
|
1748
|
+
* | | a |
|
|
1749
|
+
* > | | x |
|
|
1750
|
+
* ^
|
|
1751
|
+
* ```
|
|
1752
|
+
*
|
|
1753
|
+
* @type {State}
|
|
1754
|
+
*/
|
|
1755
|
+
function headDelimiterNok(code) {
|
|
1756
|
+
return nok(code);
|
|
1757
|
+
}
|
|
1758
|
+
/**
|
|
1759
|
+
* Before table body row.
|
|
1760
|
+
*
|
|
1761
|
+
* ```markdown
|
|
1762
|
+
* | | a |
|
|
1763
|
+
* | | - |
|
|
1764
|
+
* > | | b |
|
|
1765
|
+
* ^
|
|
1766
|
+
* ```
|
|
1767
|
+
*
|
|
1768
|
+
* @type {State}
|
|
1769
|
+
*/
|
|
1770
|
+
function bodyRowStart(code) {
|
|
1771
|
+
effects.enter("tableRow");
|
|
1772
|
+
return bodyRowBreak(code);
|
|
1773
|
+
}
|
|
1774
|
+
/**
|
|
1775
|
+
* At break in table body row.
|
|
1776
|
+
*
|
|
1777
|
+
* ```markdown
|
|
1778
|
+
* | | a |
|
|
1779
|
+
* | | - |
|
|
1780
|
+
* > | | b |
|
|
1781
|
+
* ^
|
|
1782
|
+
* ^
|
|
1783
|
+
* ^
|
|
1784
|
+
* ```
|
|
1785
|
+
*
|
|
1786
|
+
* @type {State}
|
|
1787
|
+
*/
|
|
1788
|
+
function bodyRowBreak(code) {
|
|
1789
|
+
if (code === 124) {
|
|
1790
|
+
effects.enter("tableCellDivider");
|
|
1791
|
+
effects.consume(code);
|
|
1792
|
+
effects.exit("tableCellDivider");
|
|
1793
|
+
return bodyRowBreak;
|
|
1794
|
+
}
|
|
1795
|
+
if (code === null || markdownLineEnding(code)) {
|
|
1796
|
+
effects.exit("tableRow");
|
|
1797
|
+
return ok(code);
|
|
1798
|
+
}
|
|
1799
|
+
if (markdownSpace(code)) return factorySpace(effects, bodyRowBreak, "whitespace")(code);
|
|
1800
|
+
effects.enter("data");
|
|
1801
|
+
return bodyRowData(code);
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* In table body row data.
|
|
1805
|
+
*
|
|
1806
|
+
* ```markdown
|
|
1807
|
+
* | | a |
|
|
1808
|
+
* | | - |
|
|
1809
|
+
* > | | b |
|
|
1810
|
+
* ^
|
|
1811
|
+
* ```
|
|
1812
|
+
*
|
|
1813
|
+
* @type {State}
|
|
1814
|
+
*/
|
|
1815
|
+
function bodyRowData(code) {
|
|
1816
|
+
if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {
|
|
1817
|
+
effects.exit("data");
|
|
1818
|
+
return bodyRowBreak(code);
|
|
1819
|
+
}
|
|
1820
|
+
effects.consume(code);
|
|
1821
|
+
return code === 92 ? bodyRowEscape : bodyRowData;
|
|
1822
|
+
}
|
|
1823
|
+
/**
|
|
1824
|
+
* In table body row escape.
|
|
1825
|
+
*
|
|
1826
|
+
* ```markdown
|
|
1827
|
+
* | | a |
|
|
1828
|
+
* | | ---- |
|
|
1829
|
+
* > | | b\-c |
|
|
1830
|
+
* ^
|
|
1831
|
+
* ```
|
|
1832
|
+
*
|
|
1833
|
+
* @type {State}
|
|
1834
|
+
*/
|
|
1835
|
+
function bodyRowEscape(code) {
|
|
1836
|
+
if (code === 92 || code === 124) {
|
|
1837
|
+
effects.consume(code);
|
|
1838
|
+
return bodyRowData;
|
|
1839
|
+
}
|
|
1840
|
+
return bodyRowData(code);
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
/** @type {Resolver} */
|
|
1844
|
+
function resolveTable(events, context) {
|
|
1845
|
+
let index = -1;
|
|
1846
|
+
let inFirstCellAwaitingPipe = true;
|
|
1847
|
+
/** @type {RowKind} */
|
|
1848
|
+
let rowKind = 0;
|
|
1849
|
+
/** @type {Range} */
|
|
1850
|
+
let lastCell = [
|
|
1851
|
+
0,
|
|
1852
|
+
0,
|
|
1853
|
+
0,
|
|
1854
|
+
0
|
|
1855
|
+
];
|
|
1856
|
+
/** @type {Range} */
|
|
1857
|
+
let cell = [
|
|
1858
|
+
0,
|
|
1859
|
+
0,
|
|
1860
|
+
0,
|
|
1861
|
+
0
|
|
1862
|
+
];
|
|
1863
|
+
let afterHeadAwaitingFirstBodyRow = false;
|
|
1864
|
+
let lastTableEnd = 0;
|
|
1865
|
+
/** @type {Token | undefined} */
|
|
1866
|
+
let currentTable;
|
|
1867
|
+
/** @type {Token | undefined} */
|
|
1868
|
+
let currentBody;
|
|
1869
|
+
/** @type {Token | undefined} */
|
|
1870
|
+
let currentCell;
|
|
1871
|
+
const map = new EditMap();
|
|
1872
|
+
while (++index < events.length) {
|
|
1873
|
+
const event = events[index];
|
|
1874
|
+
const token = event[1];
|
|
1875
|
+
if (event[0] === "enter") {
|
|
1876
|
+
if (token.type === "tableHead") {
|
|
1877
|
+
afterHeadAwaitingFirstBodyRow = false;
|
|
1878
|
+
if (lastTableEnd !== 0) {
|
|
1879
|
+
flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);
|
|
1880
|
+
currentBody = void 0;
|
|
1881
|
+
lastTableEnd = 0;
|
|
1882
|
+
}
|
|
1883
|
+
currentTable = {
|
|
1884
|
+
type: "table",
|
|
1885
|
+
start: Object.assign({}, token.start),
|
|
1886
|
+
end: Object.assign({}, token.end)
|
|
1887
|
+
};
|
|
1888
|
+
map.add(index, 0, [[
|
|
1889
|
+
"enter",
|
|
1890
|
+
currentTable,
|
|
1891
|
+
context
|
|
1892
|
+
]]);
|
|
1893
|
+
} else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
|
|
1894
|
+
inFirstCellAwaitingPipe = true;
|
|
1895
|
+
currentCell = void 0;
|
|
1896
|
+
lastCell = [
|
|
1897
|
+
0,
|
|
1898
|
+
0,
|
|
1899
|
+
0,
|
|
1900
|
+
0
|
|
1901
|
+
];
|
|
1902
|
+
cell = [
|
|
1903
|
+
0,
|
|
1904
|
+
index + 1,
|
|
1905
|
+
0,
|
|
1906
|
+
0
|
|
1907
|
+
];
|
|
1908
|
+
if (afterHeadAwaitingFirstBodyRow) {
|
|
1909
|
+
afterHeadAwaitingFirstBodyRow = false;
|
|
1910
|
+
currentBody = {
|
|
1911
|
+
type: "tableBody",
|
|
1912
|
+
start: Object.assign({}, token.start),
|
|
1913
|
+
end: Object.assign({}, token.end)
|
|
1914
|
+
};
|
|
1915
|
+
map.add(index, 0, [[
|
|
1916
|
+
"enter",
|
|
1917
|
+
currentBody,
|
|
1918
|
+
context
|
|
1919
|
+
]]);
|
|
1920
|
+
}
|
|
1921
|
+
rowKind = token.type === "tableDelimiterRow" ? 2 : currentBody ? 3 : 1;
|
|
1922
|
+
} else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
|
|
1923
|
+
inFirstCellAwaitingPipe = false;
|
|
1924
|
+
if (cell[2] === 0) {
|
|
1925
|
+
if (lastCell[1] !== 0) {
|
|
1926
|
+
cell[0] = cell[1];
|
|
1927
|
+
currentCell = flushCell(map, context, lastCell, rowKind, void 0, currentCell);
|
|
1928
|
+
lastCell = [
|
|
1929
|
+
0,
|
|
1930
|
+
0,
|
|
1931
|
+
0,
|
|
1932
|
+
0
|
|
1933
|
+
];
|
|
1934
|
+
}
|
|
1935
|
+
cell[2] = index;
|
|
1936
|
+
}
|
|
1937
|
+
} else if (token.type === "tableCellDivider") if (inFirstCellAwaitingPipe) inFirstCellAwaitingPipe = false;
|
|
1938
|
+
else {
|
|
1939
|
+
if (lastCell[1] !== 0) {
|
|
1940
|
+
cell[0] = cell[1];
|
|
1941
|
+
currentCell = flushCell(map, context, lastCell, rowKind, void 0, currentCell);
|
|
1942
|
+
}
|
|
1943
|
+
lastCell = cell;
|
|
1944
|
+
cell = [
|
|
1945
|
+
lastCell[1],
|
|
1946
|
+
index,
|
|
1947
|
+
0,
|
|
1948
|
+
0
|
|
1949
|
+
];
|
|
1950
|
+
}
|
|
1951
|
+
} else if (token.type === "tableHead") {
|
|
1952
|
+
afterHeadAwaitingFirstBodyRow = true;
|
|
1953
|
+
lastTableEnd = index;
|
|
1954
|
+
} else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
|
|
1955
|
+
lastTableEnd = index;
|
|
1956
|
+
if (lastCell[1] !== 0) {
|
|
1957
|
+
cell[0] = cell[1];
|
|
1958
|
+
currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);
|
|
1959
|
+
} else if (cell[1] !== 0) currentCell = flushCell(map, context, cell, rowKind, index, currentCell);
|
|
1960
|
+
rowKind = 0;
|
|
1961
|
+
} else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) cell[3] = index;
|
|
1962
|
+
}
|
|
1963
|
+
if (lastTableEnd !== 0) flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);
|
|
1964
|
+
map.consume(context.events);
|
|
1965
|
+
index = -1;
|
|
1966
|
+
while (++index < context.events.length) {
|
|
1967
|
+
const event = context.events[index];
|
|
1968
|
+
if (event[0] === "enter" && event[1].type === "table") event[1]._align = gfmTableAlign(context.events, index);
|
|
1969
|
+
}
|
|
1970
|
+
return events;
|
|
1971
|
+
}
|
|
1972
|
+
/**
|
|
1973
|
+
* Generate a cell.
|
|
1974
|
+
*
|
|
1975
|
+
* @param {EditMap} map
|
|
1976
|
+
* @param {Readonly<TokenizeContext>} context
|
|
1977
|
+
* @param {Readonly<Range>} range
|
|
1978
|
+
* @param {RowKind} rowKind
|
|
1979
|
+
* @param {number | undefined} rowEnd
|
|
1980
|
+
* @param {Token | undefined} previousCell
|
|
1981
|
+
* @returns {Token | undefined}
|
|
1982
|
+
*/
|
|
1983
|
+
function flushCell(map, context, range, rowKind, rowEnd, previousCell) {
|
|
1984
|
+
const groupName = rowKind === 1 ? "tableHeader" : rowKind === 2 ? "tableDelimiter" : "tableData";
|
|
1985
|
+
const valueName = "tableContent";
|
|
1986
|
+
if (range[0] !== 0) {
|
|
1987
|
+
previousCell.end = Object.assign({}, getPoint(context.events, range[0]));
|
|
1988
|
+
map.add(range[0], 0, [[
|
|
1989
|
+
"exit",
|
|
1990
|
+
previousCell,
|
|
1991
|
+
context
|
|
1992
|
+
]]);
|
|
1993
|
+
}
|
|
1994
|
+
const now = getPoint(context.events, range[1]);
|
|
1995
|
+
previousCell = {
|
|
1996
|
+
type: groupName,
|
|
1997
|
+
start: Object.assign({}, now),
|
|
1998
|
+
end: Object.assign({}, now)
|
|
1999
|
+
};
|
|
2000
|
+
map.add(range[1], 0, [[
|
|
2001
|
+
"enter",
|
|
2002
|
+
previousCell,
|
|
2003
|
+
context
|
|
2004
|
+
]]);
|
|
2005
|
+
if (range[2] !== 0) {
|
|
2006
|
+
const relatedStart = getPoint(context.events, range[2]);
|
|
2007
|
+
const relatedEnd = getPoint(context.events, range[3]);
|
|
2008
|
+
/** @type {Token} */
|
|
2009
|
+
const valueToken = {
|
|
2010
|
+
type: valueName,
|
|
2011
|
+
start: Object.assign({}, relatedStart),
|
|
2012
|
+
end: Object.assign({}, relatedEnd)
|
|
2013
|
+
};
|
|
2014
|
+
map.add(range[2], 0, [[
|
|
2015
|
+
"enter",
|
|
2016
|
+
valueToken,
|
|
2017
|
+
context
|
|
2018
|
+
]]);
|
|
2019
|
+
if (rowKind !== 2) {
|
|
2020
|
+
const start = context.events[range[2]];
|
|
2021
|
+
const end = context.events[range[3]];
|
|
2022
|
+
start[1].end = Object.assign({}, end[1].end);
|
|
2023
|
+
start[1].type = "chunkText";
|
|
2024
|
+
start[1].contentType = "text";
|
|
2025
|
+
if (range[3] > range[2] + 1) {
|
|
2026
|
+
const a = range[2] + 1;
|
|
2027
|
+
const b = range[3] - range[2] - 1;
|
|
2028
|
+
map.add(a, b, []);
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
map.add(range[3] + 1, 0, [[
|
|
2032
|
+
"exit",
|
|
2033
|
+
valueToken,
|
|
2034
|
+
context
|
|
2035
|
+
]]);
|
|
2036
|
+
}
|
|
2037
|
+
if (rowEnd !== void 0) {
|
|
2038
|
+
previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));
|
|
2039
|
+
map.add(rowEnd, 0, [[
|
|
2040
|
+
"exit",
|
|
2041
|
+
previousCell,
|
|
2042
|
+
context
|
|
2043
|
+
]]);
|
|
2044
|
+
previousCell = void 0;
|
|
2045
|
+
}
|
|
2046
|
+
return previousCell;
|
|
2047
|
+
}
|
|
2048
|
+
/**
|
|
2049
|
+
* Generate table end (and table body end).
|
|
2050
|
+
*
|
|
2051
|
+
* @param {Readonly<EditMap>} map
|
|
2052
|
+
* @param {Readonly<TokenizeContext>} context
|
|
2053
|
+
* @param {number} index
|
|
2054
|
+
* @param {Token} table
|
|
2055
|
+
* @param {Token | undefined} tableBody
|
|
2056
|
+
*/
|
|
2057
|
+
function flushTableEnd(map, context, index, table, tableBody) {
|
|
2058
|
+
/** @type {Array<Event>} */
|
|
2059
|
+
const exits = [];
|
|
2060
|
+
const related = getPoint(context.events, index);
|
|
2061
|
+
if (tableBody) {
|
|
2062
|
+
tableBody.end = Object.assign({}, related);
|
|
2063
|
+
exits.push([
|
|
2064
|
+
"exit",
|
|
2065
|
+
tableBody,
|
|
2066
|
+
context
|
|
2067
|
+
]);
|
|
2068
|
+
}
|
|
2069
|
+
table.end = Object.assign({}, related);
|
|
2070
|
+
exits.push([
|
|
2071
|
+
"exit",
|
|
2072
|
+
table,
|
|
2073
|
+
context
|
|
2074
|
+
]);
|
|
2075
|
+
map.add(index + 1, 0, exits);
|
|
2076
|
+
}
|
|
2077
|
+
/**
|
|
2078
|
+
* @param {Readonly<Array<Event>>} events
|
|
2079
|
+
* @param {number} index
|
|
2080
|
+
* @returns {Readonly<Point>}
|
|
2081
|
+
*/
|
|
2082
|
+
function getPoint(events, index) {
|
|
2083
|
+
const event = events[index];
|
|
2084
|
+
const side = event[0] === "enter" ? "start" : "end";
|
|
2085
|
+
return event[1][side];
|
|
2086
|
+
}
|
|
2087
|
+
//#endregion
|
|
2088
|
+
//#region ../../node_modules/.pnpm/micromark-extension-gfm-task-list-item@2.1.0/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js
|
|
2089
|
+
/**
|
|
2090
|
+
* @import {Extension, State, TokenizeContext, Tokenizer} from 'micromark-util-types'
|
|
2091
|
+
*/
|
|
2092
|
+
var tasklistCheck = {
|
|
2093
|
+
name: "tasklistCheck",
|
|
2094
|
+
tokenize: tokenizeTasklistCheck
|
|
2095
|
+
};
|
|
2096
|
+
/**
|
|
2097
|
+
* Create an HTML extension for `micromark` to support GFM task list items
|
|
2098
|
+
* syntax.
|
|
2099
|
+
*
|
|
2100
|
+
* @returns {Extension}
|
|
2101
|
+
* Extension for `micromark` that can be passed in `htmlExtensions` to
|
|
2102
|
+
* support GFM task list items when serializing to HTML.
|
|
2103
|
+
*/
|
|
2104
|
+
function gfmTaskListItem() {
|
|
2105
|
+
return { text: { [91]: tasklistCheck } };
|
|
2106
|
+
}
|
|
2107
|
+
/**
|
|
2108
|
+
* @this {TokenizeContext}
|
|
2109
|
+
* @type {Tokenizer}
|
|
2110
|
+
*/
|
|
2111
|
+
function tokenizeTasklistCheck(effects, ok, nok) {
|
|
2112
|
+
const self = this;
|
|
2113
|
+
return open;
|
|
2114
|
+
/**
|
|
2115
|
+
* At start of task list item check.
|
|
2116
|
+
*
|
|
2117
|
+
* ```markdown
|
|
2118
|
+
* > | * [x] y.
|
|
2119
|
+
* ^
|
|
2120
|
+
* ```
|
|
2121
|
+
*
|
|
2122
|
+
* @type {State}
|
|
2123
|
+
*/
|
|
2124
|
+
function open(code) {
|
|
2125
|
+
if (self.previous !== null || !self._gfmTasklistFirstContentOfListItem) return nok(code);
|
|
2126
|
+
effects.enter("taskListCheck");
|
|
2127
|
+
effects.enter("taskListCheckMarker");
|
|
2128
|
+
effects.consume(code);
|
|
2129
|
+
effects.exit("taskListCheckMarker");
|
|
2130
|
+
return inside;
|
|
2131
|
+
}
|
|
2132
|
+
/**
|
|
2133
|
+
* In task list item check.
|
|
2134
|
+
*
|
|
2135
|
+
* ```markdown
|
|
2136
|
+
* > | * [x] y.
|
|
2137
|
+
* ^
|
|
2138
|
+
* ```
|
|
2139
|
+
*
|
|
2140
|
+
* @type {State}
|
|
2141
|
+
*/
|
|
2142
|
+
function inside(code) {
|
|
2143
|
+
if (markdownLineEndingOrSpace(code)) {
|
|
2144
|
+
effects.enter("taskListCheckValueUnchecked");
|
|
2145
|
+
effects.consume(code);
|
|
2146
|
+
effects.exit("taskListCheckValueUnchecked");
|
|
2147
|
+
return close;
|
|
2148
|
+
}
|
|
2149
|
+
if (code === 88 || code === 120) {
|
|
2150
|
+
effects.enter("taskListCheckValueChecked");
|
|
2151
|
+
effects.consume(code);
|
|
2152
|
+
effects.exit("taskListCheckValueChecked");
|
|
2153
|
+
return close;
|
|
2154
|
+
}
|
|
2155
|
+
return nok(code);
|
|
2156
|
+
}
|
|
2157
|
+
/**
|
|
2158
|
+
* At close of task list item check.
|
|
2159
|
+
*
|
|
2160
|
+
* ```markdown
|
|
2161
|
+
* > | * [x] y.
|
|
2162
|
+
* ^
|
|
2163
|
+
* ```
|
|
2164
|
+
*
|
|
2165
|
+
* @type {State}
|
|
2166
|
+
*/
|
|
2167
|
+
function close(code) {
|
|
2168
|
+
if (code === 93) {
|
|
2169
|
+
effects.enter("taskListCheckMarker");
|
|
2170
|
+
effects.consume(code);
|
|
2171
|
+
effects.exit("taskListCheckMarker");
|
|
2172
|
+
effects.exit("taskListCheck");
|
|
2173
|
+
return after;
|
|
2174
|
+
}
|
|
2175
|
+
return nok(code);
|
|
2176
|
+
}
|
|
2177
|
+
/**
|
|
2178
|
+
* @type {State}
|
|
2179
|
+
*/
|
|
2180
|
+
function after(code) {
|
|
2181
|
+
if (markdownLineEnding(code)) return ok(code);
|
|
2182
|
+
if (markdownSpace(code)) return effects.check({ tokenize: spaceThenNonSpace }, ok, nok)(code);
|
|
2183
|
+
return nok(code);
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* @this {TokenizeContext}
|
|
2188
|
+
* @type {Tokenizer}
|
|
2189
|
+
*/
|
|
2190
|
+
function spaceThenNonSpace(effects, ok, nok) {
|
|
2191
|
+
return factorySpace(effects, after, "whitespace");
|
|
2192
|
+
/**
|
|
2193
|
+
* After whitespace, after task list item check.
|
|
2194
|
+
*
|
|
2195
|
+
* ```markdown
|
|
2196
|
+
* > | * [x] y.
|
|
2197
|
+
* ^
|
|
2198
|
+
* ```
|
|
2199
|
+
*
|
|
2200
|
+
* @type {State}
|
|
2201
|
+
*/
|
|
2202
|
+
function after(code) {
|
|
2203
|
+
return code === null ? nok(code) : ok(code);
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
//#endregion
|
|
2207
|
+
//#region ../../node_modules/.pnpm/micromark-extension-gfm@3.0.0/node_modules/micromark-extension-gfm/index.js
|
|
2208
|
+
/**
|
|
2209
|
+
* @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions
|
|
2210
|
+
* @typedef {import('micromark-extension-gfm-strikethrough').Options} Options
|
|
2211
|
+
* @typedef {import('micromark-util-types').Extension} Extension
|
|
2212
|
+
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
|
|
2213
|
+
*/
|
|
2214
|
+
/**
|
|
2215
|
+
* Create an extension for `micromark` to enable GFM syntax.
|
|
2216
|
+
*
|
|
2217
|
+
* @param {Options | null | undefined} [options]
|
|
2218
|
+
* Configuration (optional).
|
|
2219
|
+
*
|
|
2220
|
+
* Passed to `micromark-extens-gfm-strikethrough`.
|
|
2221
|
+
* @returns {Extension}
|
|
2222
|
+
* Extension for `micromark` that can be passed in `extensions` to enable GFM
|
|
2223
|
+
* syntax.
|
|
2224
|
+
*/
|
|
2225
|
+
function gfm(options) {
|
|
2226
|
+
return combineExtensions([
|
|
2227
|
+
gfmAutolinkLiteral(),
|
|
2228
|
+
gfmFootnote(),
|
|
2229
|
+
gfmStrikethrough(options),
|
|
2230
|
+
gfmTable(),
|
|
2231
|
+
gfmTaskListItem()
|
|
2232
|
+
]);
|
|
2233
|
+
}
|
|
2234
|
+
//#endregion
|
|
2235
|
+
export { gfm as t };
|