@coderminer/vue-markdown 0.0.0-stage → 1.0.1

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.
Files changed (232) hide show
  1. package/CHANGELOG.md +226 -0
  2. package/LICENSE +21 -0
  3. package/README.md +584 -3
  4. package/README.zh-CN.md +550 -0
  5. package/dist/chunks/MarkdownBlockquote-DVXziX2t.js +16 -0
  6. package/dist/chunks/MarkdownBreak-BwCi2Itt.js +16 -0
  7. package/dist/chunks/MarkdownCode-B1k9tmW5.js +63 -0
  8. package/dist/chunks/MarkdownConfigProvider-5N3ylrIu.js +49 -0
  9. package/dist/chunks/MarkdownContent-BAK6dqo7.js +13 -0
  10. package/dist/chunks/MarkdownCustomTag-lZJHsD6f.js +46 -0
  11. package/dist/chunks/MarkdownEmphasis-CppivOEu.js +16 -0
  12. package/dist/chunks/MarkdownEmpty-Av5k6bqa.js +14 -0
  13. package/dist/chunks/MarkdownError-C0sPs5W0.js +17 -0
  14. package/dist/chunks/MarkdownFootnoteReference-Dy3Khwyj.js +22 -0
  15. package/dist/chunks/MarkdownFootnotes-BRPzkbXv.js +21 -0
  16. package/dist/chunks/MarkdownHeading-DaNcP0_6.js +29 -0
  17. package/dist/chunks/MarkdownHorizontalRule-QNe_cuUI.js +16 -0
  18. package/dist/chunks/MarkdownHtml-66lYkvwM.js +13 -0
  19. package/dist/chunks/MarkdownImage-BRy76svs.js +51 -0
  20. package/dist/chunks/MarkdownInlineCode-MXZYFwex.js +16 -0
  21. package/dist/chunks/MarkdownLink-Dbx3NwgV.js +45 -0
  22. package/dist/chunks/MarkdownList-BJ-_C71k.js +20 -0
  23. package/dist/chunks/MarkdownListItem-Z1EHIY26.js +16 -0
  24. package/dist/chunks/MarkdownLoading-D-RYtXxf.js +15 -0
  25. package/dist/chunks/MarkdownParagraph-BxLSmSaG.js +16 -0
  26. package/dist/chunks/MarkdownRenderer-OlkdsvI3.js +482 -0
  27. package/dist/chunks/MarkdownRoot-DEE6iVfh.js +23 -0
  28. package/dist/chunks/MarkdownStrikethrough-CblvbqDk.js +16 -0
  29. package/dist/chunks/MarkdownStrong-uU5MzAoJ.js +16 -0
  30. package/dist/chunks/MarkdownTable-DmBTg_CR.js +16 -0
  31. package/dist/chunks/MarkdownTableCell-eiCJe847.js +31 -0
  32. package/dist/chunks/MarkdownTableRow-DuJaPntg.js +16 -0
  33. package/dist/chunks/MarkdownTableSection-PFHz-R33.js +24 -0
  34. package/dist/chunks/MarkdownTaskItem-BcmKo1lk.js +38 -0
  35. package/dist/chunks/MarkdownToc-DHWWoH6t.js +49 -0
  36. package/dist/chunks/MarkdownTocItem-DT9mR3vL.js +25 -0
  37. package/dist/chunks/MermaidLiveEditor-1TKkI5bp.js +414 -0
  38. package/dist/chunks/VueSyntaxHighlighter-BWpCO-cX.js +260 -0
  39. package/dist/chunks/adapters-CMwX_NEI.js +26 -0
  40. package/dist/chunks/asyncToGenerator-ChigusFD.js +26 -0
  41. package/dist/chunks/blank-line-CKKsFeKR.js +88 -0
  42. package/dist/chunks/codemirror-DyphMAEg.js +82 -0
  43. package/dist/chunks/config-aRYo2R8_.js +10 -0
  44. package/dist/chunks/context-8NfW6fxI.js +30 -0
  45. package/dist/chunks/convert-hast-C4Rg2ZuF.js +6 -0
  46. package/dist/chunks/default-ZQ5aHh-N.js +3 -0
  47. package/dist/chunks/diagnostics-CtHoJyiX.js +23 -0
  48. package/dist/chunks/export-BrgMLgUp.js +1574 -0
  49. package/dist/chunks/hast-to-nodes-DuZsi4XT.js +29 -0
  50. package/dist/chunks/hast-util-from-html-D3e_iQ89.js +5088 -0
  51. package/dist/chunks/highlightjs-BxJFpKS1.js +196 -0
  52. package/dist/chunks/identity-Bi27FKyx.js +6243 -0
  53. package/dist/chunks/labels-BtHiUTQI.js +47 -0
  54. package/dist/chunks/lib-CCnkLL6S.js +252 -0
  55. package/dist/chunks/longest-streak-DZE_EqsU.js +8 -0
  56. package/dist/chunks/micromark-factory-space-CpXAnYUY.js +137 -0
  57. package/dist/chunks/normalize-VKfQXZiK.js +226 -0
  58. package/dist/chunks/objectSpread2-CtBNx0TF.js +57 -0
  59. package/dist/chunks/plugin-YWo5uqTh.js +27 -0
  60. package/dist/chunks/preset-BjaOuJUL.js +44 -0
  61. package/dist/chunks/registry-B7BfEkuy.js +6150 -0
  62. package/dist/chunks/render-DAqK0w5J.js +1754 -0
  63. package/dist/chunks/rolldown-runtime-QGRDbDUS.js +19 -0
  64. package/dist/chunks/runtime-D95F41zG.js +574 -0
  65. package/dist/chunks/security-y4EwUyAs.js +212 -0
  66. package/dist/chunks/shared-NjFDPmkb.js +67 -0
  67. package/dist/chunks/space-separated-tokens-1ebNqf35.js +1097 -0
  68. package/dist/chunks/url-D2BoivaE.js +24 -0
  69. package/dist/chunks/useActiveHeading-CnyGTG1u.js +359 -0
  70. package/dist/components/CodeBlock.d.ts +73 -0
  71. package/dist/components/CodeBlock.js +1 -0
  72. package/dist/components/Icon.d.ts +6 -0
  73. package/dist/components/MarkdownBlockquote.d.ts +18 -0
  74. package/dist/components/MarkdownBlockquote.js +1 -0
  75. package/dist/components/MarkdownBreak.d.ts +8 -0
  76. package/dist/components/MarkdownBreak.js +1 -0
  77. package/dist/components/MarkdownChildren.d.ts +17 -0
  78. package/dist/components/MarkdownCode.d.ts +29 -0
  79. package/dist/components/MarkdownCode.js +1 -0
  80. package/dist/components/MarkdownConfigProvider.d.ts +33 -0
  81. package/dist/components/MarkdownConfigProvider.js +1 -0
  82. package/dist/components/MarkdownContent.d.ts +16 -0
  83. package/dist/components/MarkdownContent.js +1 -0
  84. package/dist/components/MarkdownCustomTag.d.ts +20 -0
  85. package/dist/components/MarkdownCustomTag.js +1 -0
  86. package/dist/components/MarkdownEmphasis.d.ts +18 -0
  87. package/dist/components/MarkdownEmphasis.js +1 -0
  88. package/dist/components/MarkdownEmpty.d.ts +8 -0
  89. package/dist/components/MarkdownEmpty.js +1 -0
  90. package/dist/components/MarkdownError.d.ts +11 -0
  91. package/dist/components/MarkdownError.js +1 -0
  92. package/dist/components/MarkdownFootnoteReference.d.ts +19 -0
  93. package/dist/components/MarkdownFootnoteReference.js +1 -0
  94. package/dist/components/MarkdownFootnotes.d.ts +17 -0
  95. package/dist/components/MarkdownFootnotes.js +1 -0
  96. package/dist/components/MarkdownHeading.d.ts +18 -0
  97. package/dist/components/MarkdownHeading.js +1 -0
  98. package/dist/components/MarkdownHorizontalRule.d.ts +8 -0
  99. package/dist/components/MarkdownHorizontalRule.js +1 -0
  100. package/dist/components/MarkdownHtml.d.ts +8 -0
  101. package/dist/components/MarkdownHtml.js +1 -0
  102. package/dist/components/MarkdownImage.d.ts +15 -0
  103. package/dist/components/MarkdownImage.js +1 -0
  104. package/dist/components/MarkdownInlineCode.d.ts +18 -0
  105. package/dist/components/MarkdownInlineCode.js +1 -0
  106. package/dist/components/MarkdownLink.d.ts +22 -0
  107. package/dist/components/MarkdownLink.js +1 -0
  108. package/dist/components/MarkdownList.d.ts +18 -0
  109. package/dist/components/MarkdownList.js +1 -0
  110. package/dist/components/MarkdownListItem.d.ts +18 -0
  111. package/dist/components/MarkdownListItem.js +1 -0
  112. package/dist/components/MarkdownLoading.d.ts +8 -0
  113. package/dist/components/MarkdownLoading.js +1 -0
  114. package/dist/components/MarkdownMath.d.ts +12 -0
  115. package/dist/components/MarkdownMath.js +1 -0
  116. package/dist/components/MarkdownMermaid.d.ts +78 -0
  117. package/dist/components/MarkdownMermaid.js +1 -0
  118. package/dist/components/MarkdownParagraph.d.ts +18 -0
  119. package/dist/components/MarkdownParagraph.js +1 -0
  120. package/dist/components/MarkdownRenderer.d.ts +167 -0
  121. package/dist/components/MarkdownRenderer.js +1 -0
  122. package/dist/components/MarkdownRoot.d.ts +24 -0
  123. package/dist/components/MarkdownRoot.js +1 -0
  124. package/dist/components/MarkdownStrikethrough.d.ts +18 -0
  125. package/dist/components/MarkdownStrikethrough.js +1 -0
  126. package/dist/components/MarkdownStrong.d.ts +18 -0
  127. package/dist/components/MarkdownStrong.js +1 -0
  128. package/dist/components/MarkdownTable.d.ts +18 -0
  129. package/dist/components/MarkdownTable.js +1 -0
  130. package/dist/components/MarkdownTableCell.d.ts +20 -0
  131. package/dist/components/MarkdownTableCell.js +1 -0
  132. package/dist/components/MarkdownTableRow.d.ts +18 -0
  133. package/dist/components/MarkdownTableRow.js +1 -0
  134. package/dist/components/MarkdownTableSection.d.ts +18 -0
  135. package/dist/components/MarkdownTableSection.js +1 -0
  136. package/dist/components/MarkdownTaskItem.d.ts +20 -0
  137. package/dist/components/MarkdownTaskItem.js +1 -0
  138. package/dist/components/MarkdownToc.d.ts +36 -0
  139. package/dist/components/MarkdownToc.js +1 -0
  140. package/dist/components/MarkdownTocItem.d.ts +14 -0
  141. package/dist/components/MarkdownTocItem.js +1 -0
  142. package/dist/components/MermaidBlock.d.ts +50 -0
  143. package/dist/components/MermaidBlock.js +1 -0
  144. package/dist/components/MermaidLiveEditor.d.ts +44 -0
  145. package/dist/components/MermaidLiveEditor.js +1 -0
  146. package/dist/components/VueSyntaxHighlighter.d.ts +39 -0
  147. package/dist/components/VueSyntaxHighlighter.js +1 -0
  148. package/dist/components/codeRegion.d.ts +14 -0
  149. package/dist/components/config.d.ts +7 -0
  150. package/dist/components/context.d.ts +45 -0
  151. package/dist/components/index.d.ts +42 -0
  152. package/dist/components/index.js +38 -0
  153. package/dist/components/render.d.ts +9 -0
  154. package/dist/components/scroll-lock.d.ts +7 -0
  155. package/dist/components/types.d.ts +61 -0
  156. package/dist/composables/useActiveHeading.d.ts +12 -0
  157. package/dist/composables/useCodeHighlighter.d.ts +30 -0
  158. package/dist/composables/useLineWindow.d.ts +38 -0
  159. package/dist/composables/useMarkdownDocument.d.ts +25 -0
  160. package/dist/core/adapters.d.ts +7 -0
  161. package/dist/core/config.d.ts +5 -0
  162. package/dist/core/diagnostics.d.ts +9 -0
  163. package/dist/core/finalize.d.ts +18 -0
  164. package/dist/core/hast-nodes.d.ts +3 -0
  165. package/dist/core/hast-to-nodes.d.ts +9 -0
  166. package/dist/core/highlight-lines.d.ts +8 -0
  167. package/dist/core/identity.d.ts +4 -0
  168. package/dist/core/labels.d.ts +4 -0
  169. package/dist/core/manifest.d.ts +38 -0
  170. package/dist/core/memo.d.ts +5 -0
  171. package/dist/core/model-hast.d.ts +8 -0
  172. package/dist/core/model.d.ts +10 -0
  173. package/dist/core/normalize.d.ts +37 -0
  174. package/dist/core/parts.d.ts +136 -0
  175. package/dist/core/preset.d.ts +10 -0
  176. package/dist/core/run.d.ts +16 -0
  177. package/dist/core/search.d.ts +5 -0
  178. package/dist/core/security.d.ts +21 -0
  179. package/dist/core/slugger.d.ts +13 -0
  180. package/dist/core/types.d.ts +392 -0
  181. package/dist/core/url.d.ts +10 -0
  182. package/dist/editor/codemirror.d.ts +14 -0
  183. package/dist/editor/index.d.ts +2 -0
  184. package/dist/editor/index.js +1 -0
  185. package/dist/export/index.d.ts +6 -0
  186. package/dist/headless.d.ts +21 -0
  187. package/dist/headless.js +12 -0
  188. package/dist/highlight/convert-hast.d.ts +8 -0
  189. package/dist/highlight/highlightjs.d.ts +7 -0
  190. package/dist/highlight/index.d.ts +4 -0
  191. package/dist/highlight/index.js +4 -0
  192. package/dist/highlight/shared.d.ts +11 -0
  193. package/dist/highlight/shiki.d.ts +7 -0
  194. package/dist/highlight/shiki.js +75 -0
  195. package/dist/html/index.d.ts +17 -0
  196. package/dist/html/index.js +11 -0
  197. package/dist/index.d.ts +24 -0
  198. package/dist/index.js +53 -0
  199. package/dist/math/index.d.ts +4 -0
  200. package/dist/math/index.js +585 -0
  201. package/dist/math/katex.d.ts +4 -0
  202. package/dist/math/plugin.d.ts +20 -0
  203. package/dist/mermaid/index.d.ts +6 -0
  204. package/dist/mermaid/index.js +8 -0
  205. package/dist/mermaid/plugin.d.ts +17 -0
  206. package/dist/mermaid/runtime.d.ts +14 -0
  207. package/dist/mermaid/sanitize-svg-lazy.d.ts +10 -0
  208. package/dist/mermaid/sanitize-svg.d.ts +3 -0
  209. package/dist/mermaid/sanitize.d.ts +16 -0
  210. package/dist/node-components.d.ts +1 -0
  211. package/dist/node-components.js +39 -0
  212. package/dist/pipeline/custom.d.ts +8 -0
  213. package/dist/pipeline/identity.d.ts +12 -0
  214. package/dist/pipeline/index.d.ts +5 -0
  215. package/dist/pipeline/official.d.ts +6 -0
  216. package/dist/pipeline.d.ts +1 -0
  217. package/dist/pipeline.js +1 -0
  218. package/dist/plugins/builtin.d.ts +15 -0
  219. package/dist/plugins/define.d.ts +7 -0
  220. package/dist/plugins/registry.d.ts +16 -0
  221. package/dist/plugins/source.d.ts +7 -0
  222. package/dist/plugins.d.ts +3 -0
  223. package/dist/plugins.js +1 -0
  224. package/dist/presets.d.ts +3 -0
  225. package/dist/presets.js +1 -0
  226. package/dist/style.css +2 -0
  227. package/dist/styles/components.css +737 -0
  228. package/dist/styles/index.d.ts +1 -0
  229. package/dist/styles/math-full.css +3 -0
  230. package/dist/styles/math.css +18 -0
  231. package/dist/styles/tokens.css +96 -0
  232. package/package.json +214 -6
package/dist/index.js ADDED
@@ -0,0 +1,53 @@
1
+ import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "./chunks/export-BrgMLgUp.js";
2
+ import { n as p, t as m } from "./chunks/labels-BtHiUTQI.js";
3
+ import { n as h, t as g } from "./chunks/diagnostics-CtHoJyiX.js";
4
+ import { n as _, r as v, t as y } from "./chunks/url-D2BoivaE.js";
5
+ import { a as b, i as x, n as S, o as C, r as w, t as T } from "./chunks/normalize-VKfQXZiK.js";
6
+ import { a as E, d as D, f as O, i as k, n as A, o as j, p as M, r as N, s as P, t as F, u as I } from "./chunks/useActiveHeading-CnyGTG1u.js";
7
+ import { _ as L, a as R, c as z, d as B, f as V, g as H, h as U, i as W, l as G, n as K, o as q, p as J, r as Y, s as X, t as Z, u as Q } from "./chunks/registry-B7BfEkuy.js";
8
+ import { a as $, i as ee, n as te, r as ne, t as re } from "./chunks/preset-BjaOuJUL.js";
9
+ import { a as ie, i as ae, n as oe, o as se, r as ce, t as le } from "./chunks/adapters-CMwX_NEI.js";
10
+ import { a as ue, i as de, n as fe, o as pe, r as me, s as he, t as ge } from "./chunks/identity-Bi27FKyx.js";
11
+ import "./pipeline.js";
12
+ import { t as _e } from "./chunks/plugin-YWo5uqTh.js";
13
+ import { n as ve, r as ye, t as be } from "./chunks/config-aRYo2R8_.js";
14
+ import { n as xe, r as Se, t as Ce } from "./chunks/context-8NfW6fxI.js";
15
+ import { a as we, i as Te, n as Ee, r as De } from "./chunks/render-DAqK0w5J.js";
16
+ import { t as Oe } from "./chunks/MarkdownCode-B1k9tmW5.js";
17
+ import { t as ke } from "./chunks/MarkdownBlockquote-DVXziX2t.js";
18
+ import { t as Ae } from "./chunks/MarkdownBreak-BwCi2Itt.js";
19
+ import { t as je } from "./chunks/MarkdownCustomTag-lZJHsD6f.js";
20
+ import { t as Me } from "./chunks/MarkdownEmphasis-CppivOEu.js";
21
+ import { t as Ne } from "./chunks/MarkdownHeading-DaNcP0_6.js";
22
+ import { t as Pe } from "./chunks/MarkdownHorizontalRule-QNe_cuUI.js";
23
+ import { t as Fe } from "./chunks/MarkdownImage-BRy76svs.js";
24
+ import { t as Ie } from "./chunks/MarkdownInlineCode-MXZYFwex.js";
25
+ import { t as Le } from "./chunks/MarkdownLink-Dbx3NwgV.js";
26
+ import { t as Re } from "./chunks/MarkdownList-BJ-_C71k.js";
27
+ import { t as ze } from "./chunks/MarkdownListItem-Z1EHIY26.js";
28
+ import { t as Be } from "./chunks/MarkdownFootnoteReference-Dy3Khwyj.js";
29
+ import { t as Ve } from "./chunks/MarkdownFootnotes-BRPzkbXv.js";
30
+ import { t as He } from "./chunks/MarkdownParagraph-BxLSmSaG.js";
31
+ import { t as Ue } from "./chunks/MarkdownStrikethrough-CblvbqDk.js";
32
+ import { t as We } from "./chunks/MarkdownTaskItem-BcmKo1lk.js";
33
+ import { t as Ge } from "./chunks/MarkdownStrong-uU5MzAoJ.js";
34
+ import { t as Ke } from "./chunks/MarkdownTable-DmBTg_CR.js";
35
+ import { t as qe } from "./chunks/MarkdownTableCell-eiCJe847.js";
36
+ import { t as Je } from "./chunks/MarkdownTableRow-DuJaPntg.js";
37
+ import { t as Ye } from "./chunks/MarkdownTableSection-PFHz-R33.js";
38
+ import { n as Xe, t as Ze } from "./chunks/MarkdownRenderer-OlkdsvI3.js";
39
+ import { t as Qe } from "./chunks/MarkdownContent-BAK6dqo7.js";
40
+ import { t as $e } from "./chunks/MarkdownEmpty-Av5k6bqa.js";
41
+ import { t as et } from "./chunks/MarkdownError-C0sPs5W0.js";
42
+ import { t as tt } from "./chunks/MarkdownLoading-D-RYtXxf.js";
43
+ import { t as nt } from "./chunks/MarkdownRoot-DEE6iVfh.js";
44
+ import { t as rt } from "./chunks/MarkdownTocItem-DT9mR3vL.js";
45
+ import { t as it } from "./chunks/MarkdownToc-DHWWoH6t.js";
46
+ import { t as at } from "./chunks/MarkdownConfigProvider-5N3ylrIu.js";
47
+ import { t as ot } from "./chunks/VueSyntaxHighlighter-BWpCO-cX.js";
48
+ import { t as st } from "./chunks/MermaidLiveEditor-1TKkI5bp.js";
49
+ import { t as ct } from "./chunks/MarkdownHtml-66lYkvwM.js";
50
+ import "./components/index.js";
51
+ // src/index.ts
52
+ var lt = "1.0.1";
53
+ export { l as COMPONENT_MANIFESTS, we as CodeBlock, m as DEFAULT_LABELS, be as MARKDOWN_CONFIG, ke as MarkdownBlockquote, Ae as MarkdownBreak, Xe as MarkdownChildren, Oe as MarkdownCode, at as MarkdownConfigProvider, Qe as MarkdownContent, je as MarkdownCustomTag, Me as MarkdownEmphasis, $e as MarkdownEmpty, et as MarkdownError, Be as MarkdownFootnoteReference, Ve as MarkdownFootnotes, Ne as MarkdownHeading, Pe as MarkdownHorizontalRule, ct as MarkdownHtml, Fe as MarkdownImage, Ie as MarkdownInlineCode, Le as MarkdownLink, Re as MarkdownList, ze as MarkdownListItem, tt as MarkdownLoading, Te as MarkdownMath, Ee as MarkdownMermaid, He as MarkdownParagraph, Ze as MarkdownRenderer, nt as MarkdownRoot, Ue as MarkdownStrikethrough, Ge as MarkdownStrong, Ke as MarkdownTable, qe as MarkdownTableCell, Je as MarkdownTableRow, Ye as MarkdownTableSection, We as MarkdownTaskItem, it as MarkdownToc, rt as MarkdownTocItem, De as MermaidBlock, st as MermaidLiveEditor, u as PARTS, t as PART_NAMES, Ce as RENDER_CONTEXT, a as TOKENS, f as TOKEN_NAMES, n as VMD_CLASS_PREFIX, ot as VueSyntaxHighlighter, me as assertPipelineResult, O as buildDocument, K as codePlugin, T as collectCustomTags, re as composePresets, U as countSearchMatches, I as createDefaultSlugger, g as createDiagnostic, ge as createMemoKey, he as createOfficialPipeline, fe as createPipelineIdentity, B as createPluginContext, Y as customTagsPlugin, W as defaultPlugins, y as defaultUrlTransform, de as defineMarkdownPipeline, V as defineMarkdownPlugin, te as defineMarkdownPreset, h as errorMessage, d as exportMarkdownHtml, o as exportMarkdownHtmlSync, S as extractToc, w as filterTocByDepth, F as findElementById, R as frontmatterPlugin, q as fullPlugins, i as getComponentManifest, X as gfmPlugin, xe as isEmptySlotContent, _ as isExternalUrl, le as isValidDiagnosticFormatter, oe as isValidHighlighter, ce as isValidMathEngine, ae as isValidMermaidRenderer, ie as isValidSlugger, se as isValidUrlTransform, z as linkPlugin, k as memoClear, E as memoGet, j as memoSet, P as memoSize, ee as mergeMarkdownConfig, $ as mergeMarkdownPreset, _e as mermaidPlugin, x as normalizeCustomTagProps, b as normalizeHast, r as partAttrs, c as partClass, ve as provideMarkdownConfig, p as resolveLabel, ue as resolvePipeline, Z as resolvePlugins, ne as resolvePreset, v as resolveUrl, H as searchDocument, G as searchPlugin, L as segmentSearch, Q as tocPlugin, A as useActiveHeading, ye as useMarkdownConfig, N as useMarkdownDocument, Se as useRenderContext, e as validateManifest, s as validateManifestRegistry, pe as validatePipeline, J as validatePlugin, lt as version, C as walkNodes, M as withDerivedDocument, D as withUniqueSlugs };
@@ -0,0 +1,4 @@
1
+ export { mathPlugin } from './plugin';
2
+ export type { MathPluginOptions } from './plugin';
3
+ export { katexEngine } from './katex';
4
+ export { default } from './katex';
@@ -0,0 +1,585 @@
1
+ import { t as e } from "../chunks/objectSpread2-CtBNx0TF.js";
2
+ import "../chunks/default-ZQ5aHh-N.js";
3
+ import { a as t, i as n, m as r, o as i, r as a, t as o } from "../chunks/micromark-factory-space-CpXAnYUY.js";
4
+ import { t as s } from "../chunks/longest-streak-DZE_EqsU.js";
5
+ import { t as c } from "../chunks/hast-to-nodes-DuZsi4XT.js";
6
+ import { n as l } from "../chunks/hast-util-from-html-D3e_iQ89.js";
7
+ import u from "katex";
8
+ // node_modules/mdast-util-math/lib/index.js
9
+ function d() {
10
+ return {
11
+ enter: {
12
+ mathFlow: e,
13
+ mathFlowFenceMeta: t,
14
+ mathText: a
15
+ },
16
+ exit: {
17
+ mathFlow: i,
18
+ mathFlowFence: r,
19
+ mathFlowFenceMeta: n,
20
+ mathFlowValue: s,
21
+ mathText: o,
22
+ mathTextData: s
23
+ }
24
+ };
25
+ function e(e) {
26
+ this.enter({
27
+ type: "math",
28
+ meta: null,
29
+ value: "",
30
+ data: {
31
+ hName: "pre",
32
+ hChildren: [{
33
+ type: "element",
34
+ tagName: "code",
35
+ properties: { className: ["language-math", "math-display"] },
36
+ children: []
37
+ }]
38
+ }
39
+ }, e);
40
+ }
41
+ function t() {
42
+ this.buffer();
43
+ }
44
+ function n() {
45
+ let e = this.resume(), t = this.stack[this.stack.length - 1];
46
+ t.type, t.meta = e;
47
+ }
48
+ function r() {
49
+ this.data.mathFlowInside || (this.buffer(), this.data.mathFlowInside = !0);
50
+ }
51
+ function i(e) {
52
+ let t = this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), n = this.stack[this.stack.length - 1];
53
+ n.type, this.exit(e), n.value = t;
54
+ let r = n.data.hChildren[0];
55
+ r.type, r.tagName, r.children.push({
56
+ type: "text",
57
+ value: t
58
+ }), this.data.mathFlowInside = void 0;
59
+ }
60
+ function a(e) {
61
+ this.enter({
62
+ type: "inlineMath",
63
+ value: "",
64
+ data: {
65
+ hName: "code",
66
+ hProperties: { className: ["language-math", "math-inline"] },
67
+ hChildren: []
68
+ }
69
+ }, e), this.buffer();
70
+ }
71
+ function o(e) {
72
+ let t = this.resume(), n = this.stack[this.stack.length - 1];
73
+ n.type, this.exit(e), n.value = t, n.data.hChildren.push({
74
+ type: "text",
75
+ value: t
76
+ });
77
+ }
78
+ function s(e) {
79
+ this.config.enter.data.call(this, e), this.config.exit.data.call(this, e);
80
+ }
81
+ }
82
+ function f(t) {
83
+ let n = (t || {}).singleDollarTextMath;
84
+ return n == null && (n = !0), i.peek = a, {
85
+ unsafe: [
86
+ {
87
+ character: "\r",
88
+ inConstruct: "mathFlowMeta"
89
+ },
90
+ {
91
+ character: "\n",
92
+ inConstruct: "mathFlowMeta"
93
+ },
94
+ {
95
+ character: "$",
96
+ after: n ? void 0 : "\\$",
97
+ inConstruct: "phrasing"
98
+ },
99
+ {
100
+ character: "$",
101
+ inConstruct: "mathFlowMeta"
102
+ },
103
+ {
104
+ atBreak: !0,
105
+ character: "$",
106
+ after: "\\$"
107
+ }
108
+ ],
109
+ handlers: {
110
+ math: r,
111
+ inlineMath: i
112
+ }
113
+ };
114
+ function r(t, n, r, i) {
115
+ let a = t.value || "", o = r.createTracker(i), c = "$".repeat(Math.max(s(a, "$") + 1, 2)), l = r.enter("mathFlow"), u = o.move(c);
116
+ if (t.meta) {
117
+ let n = r.enter("mathFlowMeta");
118
+ u += o.move(r.safe(t.meta, e({
119
+ after: "\n",
120
+ before: u,
121
+ encode: ["$"]
122
+ }, o.current()))), n();
123
+ }
124
+ return u += o.move("\n"), a && (u += o.move(a + "\n")), u += o.move(c), l(), u;
125
+ }
126
+ function i(e, t, r) {
127
+ let i = e.value || "", a = 1;
128
+ for (n || a++; RegExp("(^|[^$])" + "\\$".repeat(a) + "([^$]|$)").test(i);) a++;
129
+ let o = "$".repeat(a);
130
+ /[^ \r\n]/.test(i) && (/^[ \r\n]/.test(i) && /[ \r\n]$/.test(i) || /^\$|\$$/.test(i)) && (i = " " + i + " ");
131
+ let s = -1;
132
+ for (; ++s < r.unsafe.length;) {
133
+ let e = r.unsafe[s];
134
+ if (!e.atBreak) continue;
135
+ let t = r.compilePattern(e), n;
136
+ for (; n = t.exec(i);) {
137
+ let e = n.index;
138
+ i.codePointAt(e) === 10 && i.codePointAt(e - 1) === 13 && e--, i = i.slice(0, e) + " " + i.slice(n.index + 1);
139
+ }
140
+ }
141
+ return o + i + o;
142
+ }
143
+ function a() {
144
+ return "$";
145
+ }
146
+ }
147
+ // node_modules/micromark-extension-math/lib/math-flow.js
148
+ var p = {
149
+ tokenize: h,
150
+ concrete: !0,
151
+ name: "mathFlow"
152
+ }, m = {
153
+ tokenize: g,
154
+ partial: !0
155
+ };
156
+ function h(e, t, n) {
157
+ let i = this, a = i.events[i.events.length - 1], s = a && a[1].type === "linePrefix" ? a[2].sliceSerialize(a[1], !0).length : 0, c = 0;
158
+ return l;
159
+ function l(t) {
160
+ return e.enter("mathFlow"), e.enter("mathFlowFence"), e.enter("mathFlowFenceSequence"), u(t);
161
+ }
162
+ function u(t) {
163
+ return t === 36 ? (e.consume(t), c++, u) : c < 2 ? n(t) : (e.exit("mathFlowFenceSequence"), o(e, d, "whitespace")(t));
164
+ }
165
+ function d(t) {
166
+ return t === null || r(t) ? p(t) : (e.enter("mathFlowFenceMeta"), e.enter("chunkString", { contentType: "string" }), f(t));
167
+ }
168
+ function f(t) {
169
+ return t === null || r(t) ? (e.exit("chunkString"), e.exit("mathFlowFenceMeta"), p(t)) : t === 36 ? n(t) : (e.consume(t), f);
170
+ }
171
+ function p(n) {
172
+ return e.exit("mathFlowFence"), i.interrupt ? t(n) : e.attempt(m, h, y)(n);
173
+ }
174
+ function h(t) {
175
+ return e.attempt({
176
+ tokenize: b,
177
+ partial: !0
178
+ }, y, g)(t);
179
+ }
180
+ function g(t) {
181
+ return (s ? o(e, _, "linePrefix", s + 1) : _)(t);
182
+ }
183
+ function _(t) {
184
+ return t === null ? y(t) : r(t) ? e.attempt(m, h, y)(t) : (e.enter("mathFlowValue"), v(t));
185
+ }
186
+ function v(t) {
187
+ return t === null || r(t) ? (e.exit("mathFlowValue"), _(t)) : (e.consume(t), v);
188
+ }
189
+ function y(n) {
190
+ return e.exit("mathFlow"), t(n);
191
+ }
192
+ function b(e, t, n) {
193
+ let a = 0;
194
+ return o(e, s, "linePrefix", i.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
195
+ function s(t) {
196
+ return e.enter("mathFlowFence"), e.enter("mathFlowFenceSequence"), l(t);
197
+ }
198
+ function l(t) {
199
+ return t === 36 ? (a++, e.consume(t), l) : a < c ? n(t) : (e.exit("mathFlowFenceSequence"), o(e, u, "whitespace")(t));
200
+ }
201
+ function u(i) {
202
+ return i === null || r(i) ? (e.exit("mathFlowFence"), t(i)) : n(i);
203
+ }
204
+ }
205
+ }
206
+ function g(e, t, n) {
207
+ let r = this;
208
+ return i;
209
+ function i(n) {
210
+ return n === null ? t(n) : (e.enter("lineEnding"), e.consume(n), e.exit("lineEnding"), a);
211
+ }
212
+ function a(e) {
213
+ return r.parser.lazy[r.now().line] ? n(e) : t(e);
214
+ }
215
+ }
216
+ // node_modules/micromark-extension-math/lib/math-text.js
217
+ function _(e) {
218
+ let t = (e || {}).singleDollarTextMath;
219
+ return t == null && (t = !0), {
220
+ tokenize: n,
221
+ resolve: v,
222
+ previous: y,
223
+ name: "mathText"
224
+ };
225
+ function n(e, n, i) {
226
+ let a = 0, o, s;
227
+ return c;
228
+ function c(t) {
229
+ return e.enter("mathText"), e.enter("mathTextSequence"), l(t);
230
+ }
231
+ function l(n) {
232
+ return n === 36 ? (e.consume(n), a++, l) : a < 2 && !t ? i(n) : (e.exit("mathTextSequence"), u(n));
233
+ }
234
+ function u(t) {
235
+ return t === null ? i(t) : t === 36 ? (s = e.enter("mathTextSequence"), o = 0, f(t)) : t === 32 ? (e.enter("space"), e.consume(t), e.exit("space"), u) : r(t) ? (e.enter("lineEnding"), e.consume(t), e.exit("lineEnding"), u) : (e.enter("mathTextData"), d(t));
236
+ }
237
+ function d(t) {
238
+ return t === null || t === 32 || t === 36 || r(t) ? (e.exit("mathTextData"), u(t)) : (e.consume(t), d);
239
+ }
240
+ function f(t) {
241
+ return t === 36 ? (e.consume(t), o++, f) : o === a ? (e.exit("mathTextSequence"), e.exit("mathText"), n(t)) : (s.type = "mathTextData", d(t));
242
+ }
243
+ }
244
+ }
245
+ function v(e) {
246
+ let t = e.length - 4, n = 3, r, i;
247
+ if ((e[n][1].type === "lineEnding" || e[n][1].type === "space") && (e[t][1].type === "lineEnding" || e[t][1].type === "space")) {
248
+ for (r = n; ++r < t;) if (e[r][1].type === "mathTextData") {
249
+ e[t][1].type = "mathTextPadding", e[n][1].type = "mathTextPadding", n += 2, t -= 2;
250
+ break;
251
+ }
252
+ }
253
+ for (r = n - 1, t++; ++r <= t;) i === void 0 ? r !== t && e[r][1].type !== "lineEnding" && (i = r) : (r === t || e[r][1].type === "lineEnding") && (e[i][1].type = "mathTextData", r !== i + 2 && (e[i][1].end = e[r - 1][1].end, e.splice(i + 2, r - i - 2), t -= r - i - 2, r = i + 2), i = void 0);
254
+ return e;
255
+ }
256
+ function y(e) {
257
+ return e !== 36 || this.events[this.events.length - 1][1].type === "characterEscape";
258
+ }
259
+ // node_modules/micromark-extension-math/lib/syntax.js
260
+ function b(e) {
261
+ return {
262
+ flow: { 36: p },
263
+ text: { 36: _(e) }
264
+ };
265
+ }
266
+ // node_modules/remark-math/lib/index.js
267
+ var x = {};
268
+ function ee(e) {
269
+ let t = this, n = e || x, r = t.data(), i = r.micromarkExtensions || (r.micromarkExtensions = []), a = r.fromMarkdownExtensions || (r.fromMarkdownExtensions = []), o = r.toMarkdownExtensions || (r.toMarkdownExtensions = []);
270
+ i.push(b(n)), a.push(d()), o.push(f(n));
271
+ }
272
+ // node_modules/unist-util-remove-position/lib/index.js
273
+ function S(e, t) {
274
+ let n = (t || {}).force || !1;
275
+ a(e, r);
276
+ function r(e) {
277
+ n ? delete e.position : e.position = void 0;
278
+ }
279
+ }
280
+ // node_modules/hast-util-from-html-isomorphic/lib/index.js
281
+ function te(e, t) {
282
+ let n = l(e, t);
283
+ return S(n, { force: !0 }), delete n.data, n;
284
+ }
285
+ // node_modules/unist-util-find-after/lib/index.js
286
+ var C = (function(e, t, n) {
287
+ let r = i(n);
288
+ if (!e || !e.type || !e.children) throw Error("Expected parent node");
289
+ if (typeof t == "number") {
290
+ if (t < 0 || t === Infinity) throw Error("Expected positive finite number as index");
291
+ } else if (t = e.children.indexOf(t), t < 0) throw Error("Expected child node or index");
292
+ for (; ++t < e.children.length;) if (r(e.children[t], t, e)) return e.children[t];
293
+ }), w = (function(e) {
294
+ if (e == null) return re;
295
+ if (typeof e == "string") return T(e);
296
+ if (typeof e == "object") return ne(e);
297
+ if (typeof e == "function") return E(e);
298
+ throw Error("Expected function, string, or array as `test`");
299
+ });
300
+ function ne(e) {
301
+ let t = [], n = -1;
302
+ for (; ++n < e.length;) t[n] = w(e[n]);
303
+ return E(r);
304
+ function r(...e) {
305
+ let n = -1;
306
+ for (; ++n < t.length;) if (t[n].apply(this, e)) return !0;
307
+ return !1;
308
+ }
309
+ }
310
+ function T(e) {
311
+ return E(t);
312
+ function t(t) {
313
+ return t.tagName === e;
314
+ }
315
+ }
316
+ function E(e) {
317
+ return t;
318
+ function t(t, n, r) {
319
+ return !!(D(t) && e.call(this, t, typeof n == "number" ? n : void 0, r || void 0));
320
+ }
321
+ }
322
+ function re(e) {
323
+ return !!(e && typeof e == "object" && "type" in e && e.type === "element" && "tagName" in e && typeof e.tagName == "string");
324
+ }
325
+ function D(e) {
326
+ return typeof e == "object" && !!e && "type" in e && "tagName" in e;
327
+ }
328
+ // node_modules/hast-util-to-text/lib/index.js
329
+ var O = /\n/g, k = /[\t ]+/g, A = w("br"), j = w(V), M = w("p"), N = w("tr"), ie = w([
330
+ "datalist",
331
+ "head",
332
+ "noembed",
333
+ "noframes",
334
+ "noscript",
335
+ "rp",
336
+ "script",
337
+ "style",
338
+ "template",
339
+ "title",
340
+ B,
341
+ H
342
+ ]), P = w(/* @__PURE__ */ "address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp".split("."));
343
+ function ae(e, t) {
344
+ let n = t || {}, r = "children" in e ? e.children : [], i = P(e), a = z(e, {
345
+ whitespace: n.whitespace || "normal",
346
+ breakBefore: !1,
347
+ breakAfter: !1
348
+ }), o = [];
349
+ (e.type === "text" || e.type === "comment") && o.push(...I(e, {
350
+ whitespace: a,
351
+ breakBefore: !0,
352
+ breakAfter: !0
353
+ }));
354
+ let s = -1;
355
+ for (; ++s < r.length;) o.push(...F(r[s], e, {
356
+ whitespace: a,
357
+ breakBefore: s ? void 0 : i,
358
+ breakAfter: s < r.length - 1 ? A(r[s + 1]) : i
359
+ }));
360
+ let c = [], l;
361
+ for (s = -1; ++s < o.length;) {
362
+ let e = o[s];
363
+ typeof e == "number" ? l !== void 0 && e > l && (l = e) : e && (l !== void 0 && l > -1 && c.push("\n".repeat(l) || " "), l = -1, c.push(e));
364
+ }
365
+ return c.join("");
366
+ }
367
+ function F(e, t, n) {
368
+ return e.type === "element" ? oe(e, t, n) : e.type === "text" ? n.whitespace === "normal" ? I(e, n) : L(e) : [];
369
+ }
370
+ function oe(e, t, n) {
371
+ let r = z(e, n), i = e.children || [], a = -1, o = [];
372
+ if (ie(e)) return o;
373
+ let s, c;
374
+ for (A(e) || N(e) && C(t, e, N) ? c = "\n" : M(e) ? (s = 2, c = 2) : P(e) && (s = 1, c = 1); ++a < i.length;) o = o.concat(F(i[a], e, {
375
+ whitespace: r,
376
+ breakBefore: a ? void 0 : s,
377
+ breakAfter: a < i.length - 1 ? A(i[a + 1]) : c
378
+ }));
379
+ return j(e) && C(t, e, j) && o.push(" "), s && o.unshift(s), c && o.push(c), o;
380
+ }
381
+ function I(e, t) {
382
+ let n = String(e.value), r = [], i = [], a = 0;
383
+ for (; a <= n.length;) {
384
+ O.lastIndex = a;
385
+ let e = O.exec(n), i = e && "index" in e ? e.index : n.length;
386
+ r.push(R(n.slice(a, i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g, ""), a !== 0 || t.breakBefore, i !== n.length || t.breakAfter)), a = i + 1;
387
+ }
388
+ let o = -1, s;
389
+ for (; ++o < r.length;) r[o].charCodeAt(r[o].length - 1) === 8203 || o < r.length - 1 && r[o + 1].charCodeAt(0) === 8203 ? (i.push(r[o]), s = void 0) : r[o] ? (typeof s == "number" && i.push(s), i.push(r[o]), s = 0) : (o === 0 || o === r.length - 1) && i.push(0);
390
+ return i;
391
+ }
392
+ function L(e) {
393
+ return [String(e.value)];
394
+ }
395
+ function R(e, t, n) {
396
+ let r = [], i = 0, a;
397
+ for (; i < e.length;) {
398
+ k.lastIndex = i;
399
+ let n = k.exec(e);
400
+ a = n ? n.index : e.length, !i && !a && n && !t && r.push(""), i !== a && r.push(e.slice(i, a)), i = n ? a + n[0].length : a;
401
+ }
402
+ return i !== a && !n && r.push(""), r.join(" ");
403
+ }
404
+ function z(e, t) {
405
+ if (e.type === "element") {
406
+ let n = e.properties || {};
407
+ switch (e.tagName) {
408
+ case "listing":
409
+ case "plaintext":
410
+ case "xmp": return "pre";
411
+ case "nobr": return "nowrap";
412
+ case "pre": return n.wrap ? "pre-wrap" : "pre";
413
+ case "td":
414
+ case "th": return n.noWrap ? "nowrap" : t.whitespace;
415
+ case "textarea": return "pre-wrap";
416
+ }
417
+ }
418
+ return t.whitespace;
419
+ }
420
+ function B(e) {
421
+ return !!(e.properties || {}).hidden;
422
+ }
423
+ function V(e) {
424
+ return e.tagName === "td" || e.tagName === "th";
425
+ }
426
+ function H(e) {
427
+ return e.tagName === "dialog" && !(e.properties || {}).open;
428
+ }
429
+ // node_modules/rehype-katex/lib/index.js
430
+ var U = {}, W = [];
431
+ function G(r) {
432
+ let i = r || U;
433
+ return function(r, a) {
434
+ t(r, "element", function(t, r) {
435
+ let o = Array.isArray(t.properties.className) ? t.properties.className : W, s = o.includes("language-math"), c = o.includes("math-display"), l = o.includes("math-inline"), d = c;
436
+ if (!s && !c && !l) return;
437
+ let f = r[r.length - 1], p = t;
438
+ /* c8 ignore next -- verbose to test. */
439
+ if (t.tagName === "code" && s && f && f.type === "element" && f.tagName === "pre" && (p = f, f = r[r.length - 2], d = !0), !f) return;
440
+ let m = ae(p, { whitespace: "pre" }), h;
441
+ try {
442
+ h = u.renderToString(m, e(e({}, i), {}, {
443
+ displayMode: d,
444
+ throwOnError: !0
445
+ }));
446
+ } catch (n) {
447
+ let o = n, s = o.name.toLowerCase();
448
+ a.message("Could not render math with KaTeX", {
449
+ ancestors: [...r, t],
450
+ cause: o,
451
+ place: t.position,
452
+ ruleId: s,
453
+ source: "rehype-katex"
454
+ });
455
+ try {
456
+ h = u.renderToString(m, e(e({}, i), {}, {
457
+ displayMode: d,
458
+ strict: "ignore",
459
+ throwOnError: !1
460
+ }));
461
+ } catch (e) {
462
+ h = [{
463
+ type: "element",
464
+ tagName: "span",
465
+ properties: {
466
+ className: ["katex-error"],
467
+ style: "color:" + (i.errorColor || "#cc0000"),
468
+ title: String(n)
469
+ },
470
+ children: [{
471
+ type: "text",
472
+ value: m
473
+ }]
474
+ }];
475
+ }
476
+ }
477
+ typeof h == "string" && (h = te(h, { fragment: !0 }).children);
478
+ let g = f.children.indexOf(p);
479
+ return f.children.splice(g, 1, ...h), n;
480
+ });
481
+ };
482
+ }
483
+ // src/math/plugin.ts
484
+ function K(e) {
485
+ var t;
486
+ let n = (t = e.properties) == null ? void 0 : t.className;
487
+ return Array.isArray(n) ? n.map(String) : typeof n == "string" ? n.split(/\s+/) : [];
488
+ }
489
+ function q(e) {
490
+ return e.type === "text" ? e.value : e.type === "element" ? e.children.map(q).join("") : "";
491
+ }
492
+ function J(e) {
493
+ let t = K(e);
494
+ return t.includes("language-math") && t.some((e) => e.startsWith("math-"));
495
+ }
496
+ function Y(e, t, n) {
497
+ return {
498
+ type: "element",
499
+ tagName: "vmd-math",
500
+ properties: {
501
+ "data-vmd-math": "",
502
+ "data-tex": t,
503
+ "data-display": e ? "true" : "false"
504
+ },
505
+ children: n
506
+ };
507
+ }
508
+ function X(t) {
509
+ return t.map((t) => {
510
+ if (t.type !== "element") return t;
511
+ if (t.tagName === "code" && J(t)) return Y(K(t).includes("math-display"), q(t), [t]);
512
+ if (t.tagName === "pre") {
513
+ let e = t.children.find((e) => e.type === "element" && e.tagName === "code" && J(e));
514
+ if (e) return Y(K(e).includes("math-display"), q(e), [t]);
515
+ }
516
+ return t.children.length > 0 ? e(e({}, t), {}, { children: X(t.children) }) : t;
517
+ });
518
+ }
519
+ function se() {
520
+ return (e) => {
521
+ e.children = X(e.children);
522
+ };
523
+ }
524
+ function Z(e) {
525
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
526
+ }
527
+ function ce(e, t) {
528
+ let n = t.inlineDelimiters, r = t.displayDelimiters;
529
+ return !n && !r ? e : e.split(/(```[\s\S]*?```|`[^`]*`)/g).map((e, t) => {
530
+ if (t % 2 == 1) return e;
531
+ let i = e;
532
+ return r && (i = i.replace(RegExp(`${Z(r[0])}([\\s\\S]*?)${Z(r[1])}`, "g"), (e, t) => `\n$$\n${t}\n$$\n`)), n && (i = i.replace(RegExp(`${Z(n[0])}([\\s\\S]*?)${Z(n[1])}`, "g"), (e, t) => `$${t}$`)), i;
533
+ }).join("");
534
+ }
535
+ function le(e = {}) {
536
+ var t, n;
537
+ return {
538
+ name: "math",
539
+ remarkPlugins: [[ee, { singleDollarTextMath: (t = e.singleDollarTextMath) == null || t }]],
540
+ rehypePlugins: [se, [G, (n = e.katex) == null ? {} : n]],
541
+ transformSource: (t) => ce(t, e)
542
+ };
543
+ }
544
+ // src/core/hast-nodes.ts
545
+ function ue(e) {
546
+ return c(l(e, { fragment: !0 }).children);
547
+ }
548
+ // src/math/katex.ts
549
+ var Q = /* @__PURE__ */ new Map(), de = 256;
550
+ function fe(t) {
551
+ return e({
552
+ displayMode: !!t.displayMode,
553
+ throwOnError: !1,
554
+ trust: !1,
555
+ strict: "warn",
556
+ output: "htmlAndMathml"
557
+ }, t);
558
+ }
559
+ var $ = {
560
+ id: "katex",
561
+ render(e, t) {
562
+ let n = `${e}\u001e${JSON.stringify(t)}`, r = Q.get(n);
563
+ if (r) return r;
564
+ let i = fe(t);
565
+ try {
566
+ let t = u.renderToString(e, i), r = { nodes: ue(t) };
567
+ if (t.includes("katex-error") && (r.error = "Invalid TeX expression."), Q.set(n, r), Q.size > de) {
568
+ let e = Q.keys().next().value;
569
+ e !== void 0 && Q.delete(e);
570
+ }
571
+ return r;
572
+ } catch (t) {
573
+ let r = {
574
+ nodes: [{
575
+ kind: "text",
576
+ key: "math-error",
577
+ value: e
578
+ }],
579
+ error: t instanceof Error ? t.message : String(t)
580
+ };
581
+ return Q.set(n, r), r;
582
+ }
583
+ }
584
+ };
585
+ export { $ as default, $ as katexEngine, le as mathPlugin };
@@ -0,0 +1,4 @@
1
+ import { MathEngine } from '../core/types';
2
+ /** Default KaTeX engine. Invalid TeX becomes readable error markup. */
3
+ export declare const katexEngine: MathEngine;
4
+ export default katexEngine;
@@ -0,0 +1,20 @@
1
+ import { Root } from 'hast';
2
+ import { MarkdownPlugin } from '../core/types';
3
+ export interface MathPluginOptions {
4
+ /** Enable `$...$` inline math (remark-math option). */
5
+ singleDollarTextMath?: boolean;
6
+ /** Optional custom inline delimiters, e.g. `['\\(', '\\)']`. */
7
+ inlineDelimiters?: [string, string];
8
+ /** Optional custom display delimiters, e.g. `['\\[', '\\]']`. */
9
+ displayDelimiters?: [string, string];
10
+ /** Options passed to rehype-katex. */
11
+ katex?: Record<string, unknown>;
12
+ }
13
+ declare function rehypeMathAnnotation(): (tree: Root) => void;
14
+ /**
15
+ * Official math plugin. Math is parsed with remark-math, annotated with its
16
+ * TeX source, then rendered by rehype-katex. The annotation survives so custom
17
+ * engines can re-render from the source.
18
+ */
19
+ export declare function mathPlugin(options?: MathPluginOptions): MarkdownPlugin;
20
+ export { rehypeMathAnnotation };
@@ -0,0 +1,6 @@
1
+ export { renderMermaid, resetMermaidRuntime } from './runtime';
2
+ export { sanitizeSvg } from './sanitize-svg';
3
+ export { MERMAID_ALLOWED_TAGS } from './sanitize';
4
+ export { mermaidPlugin } from './plugin';
5
+ export type { MermaidPluginOptions } from './plugin';
6
+ export { default } from './runtime';
@@ -0,0 +1,8 @@
1
+ import { t as e } from "../chunks/plugin-YWo5uqTh.js";
2
+ import { a as t, n, o as r, r as i } from "../chunks/runtime-D95F41zG.js";
3
+ import { n as a } from "../chunks/hast-util-from-html-D3e_iQ89.js";
4
+ // src/mermaid/sanitize-svg.ts
5
+ function o(e) {
6
+ return r(a(e, { fragment: !0 }).children);
7
+ }
8
+ export { t as MERMAID_ALLOWED_TAGS, n as default, n as renderMermaid, e as mermaidPlugin, i as resetMermaidRuntime, o as sanitizeSvg };