@mintlify/msft-sdk 1.1.47 → 1.1.49

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 (31) hide show
  1. package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +7 -6
  2. package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js.map +1 -1
  3. package/dist/api-playground/EndpointFields/index.js +4 -3
  4. package/dist/api-playground/EndpointFields/index.js.map +1 -1
  5. package/dist/components/Api/Markdown.js +36 -40
  6. package/dist/components/Api/Markdown.js.map +1 -1
  7. package/dist/components/content-components/all-components.js +25 -23
  8. package/dist/components/content-components/all-components.js.map +1 -1
  9. package/dist/components/content-components/callouts.js +12 -5
  10. package/dist/components/content-components/callouts.js.map +1 -1
  11. package/dist/components/content-components/latex.js +30 -0
  12. package/dist/components/content-components/latex.js.map +1 -0
  13. package/dist/components/mdx-renderer.js +1 -9
  14. package/dist/components/mdx-renderer.js.map +1 -1
  15. package/dist/components/nav-tree/index.js +80 -67
  16. package/dist/components/nav-tree/index.js.map +1 -1
  17. package/dist/index.d.ts +11 -0
  18. package/dist/index.js +59 -55
  19. package/dist/index.js.map +1 -1
  20. package/dist/parser/convert-html-to-mdx.js +17 -16
  21. package/dist/parser/convert-html-to-mdx.js.map +1 -1
  22. package/dist/parser/serialize-mdx.js +17 -15
  23. package/dist/parser/serialize-mdx.js.map +1 -1
  24. package/dist/plugins/sanitize/rehype-latex.js +31 -0
  25. package/dist/plugins/sanitize/rehype-latex.js.map +1 -0
  26. package/dist/plugins/sanitize/rehype-pre-to-mdx-fence.js +13 -13
  27. package/dist/plugins/sanitize/rehype-pre-to-mdx-fence.js.map +1 -1
  28. package/dist/plugins/sanitize/rehype-remark.js +4 -3
  29. package/dist/plugins/sanitize/rehype-remark.js.map +1 -1
  30. package/dist/styles.css +1 -1
  31. package/package.json +4 -1
package/dist/index.js CHANGED
@@ -5,14 +5,14 @@ import { PlainTextPage as n } from "./components/plain-text-page.js";
5
5
  import { createDefaultComponents as l, defaultComponents as i } from "./components/content-components/default-components.js";
6
6
  import { ComponentsProvider as s, useComponents as C } from "./context/components-context.js";
7
7
  import { NavTree as P } from "./components/nav-tree/index.js";
8
- import { useApiReference as c } from "./components/Api/ApiReferenceProvider.js";
8
+ import { useApiReference as y } from "./components/Api/ApiReferenceProvider.js";
9
9
  import { ApiReferenceContext as T, ApiReferenceContext2 as b, ApiReferenceProvider as v, ApiReferenceProvider2 as A, DeploymentMetadataContext as H, DeploymentMetadataProvider as h, DocsConfigContext as D, DocsConfigProvider as R, PageContext as M, PageProvider as k } from "./contexts/ConfigContext.js";
10
10
  import { TableOfContents as w } from "./components/toc/index.js";
11
- import { PivotAwareTOC as I } from "./components/toc/pivot-aware-toc.js";
12
- import { PageContextMenu as E } from "./components/page-context-menu.js";
11
+ import { PivotAwareTOC as L } from "./components/toc/pivot-aware-toc.js";
12
+ import { PageContextMenu as N } from "./components/page-context-menu.js";
13
13
  import { copyMarkdownToClipboard as O, getPageMarkdown as Z, useMarkdownCopy as z } from "./hooks/useMarkdownCopy.js";
14
- import { generateLlmsFullTxt as q, generateLlmsTxt as G } from "./utils/generate-llms-txt.js";
15
- import { getNodeText as W } from "./utils/get-node-text.js";
14
+ import { generateLlmsFullTxt as X, generateLlmsTxt as q } from "./utils/generate-llms-txt.js";
15
+ import { getNodeText as J } from "./utils/get-node-text.js";
16
16
  import { capitalize as j } from "./utils/string.js";
17
17
  import { cn as Q } from "./utils/cn.js";
18
18
  import { getClassNames as V, getTextContent as Y, isElement as _ } from "./utils/rehype.js";
@@ -25,19 +25,19 @@ import { OperationPage as ie } from "./api-playground-2/OperationPage.js";
25
25
  import { SchemaPage as se } from "./api-playground-2/SchemaPage.js";
26
26
  import { ApiExamples as ge } from "./api-playground-2/ApiExamples.js";
27
27
  import { ApiFields as ue } from "./api-playground-2/ApiFields.js";
28
- import { Playground as ye } from "./api-playground-2/Playground.js";
28
+ import { Playground as ce } from "./api-playground-2/Playground.js";
29
29
  import { EndpointHeader as be } from "./api-playground-2/EndpointHeader.js";
30
30
  import { ApiPlaygroundContext as Ae } from "./api-playground-2/contexts/ApiPlaygroundContext.js";
31
31
  import { usePlaygroundInputsStore as he, useSelectedSecurityOption as De } from "./api-playground-2/hooks/usePlaygroundInputsStore.js";
32
32
  import { useSendPlaygroundRequest as Me } from "./api-playground-2/hooks/useSendPlaygroundRequest.js";
33
33
  import { useInitializeInputs as Se } from "./api-playground-2/hooks/useInitializeInputs.js";
34
34
  import { useCopyPathWithInputs as Fe } from "./api-playground-2/hooks/useCopyPathWithInputs.js";
35
- import { addApiReferenceDataFromMdxAndDocsConfig as Ne } from "./api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js";
36
- import { processSecurityOptions as Le } from "./api-playground-2/schemaGraph/processSecurityOptions.js";
35
+ import { addApiReferenceDataFromMdxAndDocsConfig as Ie } from "./api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js";
36
+ import { processSecurityOptions as Ee } from "./api-playground-2/schemaGraph/processSecurityOptions.js";
37
37
  import { getApiReferenceDataFromGraph as Ze } from "./api-playground-2/schemaGraph/getApiReferenceDataFromGraph.js";
38
38
  import { ApiPlayground as Be } from "./api-playground/ApiPlayground/index.js";
39
- import { ApiPlaygroundContext as Ge } from "./api-playground/ApiPlayground/ApiPlaygroundContext.js";
40
- import { default as We } from "./api-playground/EndpointFields/index.js";
39
+ import { ApiPlaygroundContext as qe } from "./api-playground/ApiPlayground/ApiPlaygroundContext.js";
40
+ import { default as Je } from "./api-playground/EndpointFields/index.js";
41
41
  import { CodeBlock as je } from "./components/content-components/code-block.js";
42
42
  import { Heading as Qe } from "./components/content-components/heading.js";
43
43
  import { Link as Ve } from "./components/content-components/link.js";
@@ -50,28 +50,30 @@ import { ParamName as no } from "./components/content-components/param-name.js";
50
50
  import { Tabs as lo } from "./components/content-components/tabs/tabs.js";
51
51
  import { Tab as so } from "./components/content-components/tabs/tab.js";
52
52
  import { Details as go, Summary as Po } from "./components/content-components/details/details.js";
53
- import { Table as co, TableBody as yo, TableCaption as To, TableCell as bo, TableFooter as vo, TableHead as Ao, TableHeader as Ho, TableRow as ho } from "./components/content-components/table/index.js";
54
- import { allComponents as Ro } from "./components/content-components/all-components.js";
55
- import { Home as ko } from "./components/content-components/home.js";
56
- import { MobileNavTree as wo } from "./components/nav-tree/mobile-nav.js";
57
- import { rehypeCodeblocks as Io } from "./plugins/rehype/rehype-code-blocks.js";
58
- import { remarkHeadingIds as Eo } from "./plugins/remark/remark-heading-ids.js";
59
- import { sanitizePreTags as Oo } from "./plugins/sanitize/rehype-pre-to-mdx-fence.js";
60
- import { rehypeCallouts as zo } from "./plugins/sanitize/rehype-callouts.js";
61
- import { rehypeParamName as qo } from "./plugins/sanitize/rehype-param-name.js";
62
- import { rehypeTabs as Jo } from "./plugins/sanitize/rehype-tabs.js";
63
- import { rehypeDetails as Xo } from "./plugins/sanitize/rehype-details.js";
64
- import { rehypeHeadingIds as Ko } from "./plugins/sanitize/rehype-heading-ids.js";
65
- import { rehypeZonePivots as Uo } from "./plugins/sanitize/rehype-zone-pivots.js";
66
- import { mdxJsxFlowElementHandler as Yo, rehypeRemark as _o } from "./plugins/sanitize/rehype-remark.js";
67
- import { tableCellHandler as er, tableHandler as or, tableRowHandler as rr } from "./plugins/sanitize/rehype-table-align.js";
53
+ import { Table as yo, TableBody as co, TableCaption as To, TableCell as bo, TableFooter as vo, TableHead as Ao, TableHeader as Ho, TableRow as ho } from "./components/content-components/table/index.js";
54
+ import { LaTeX as Ro } from "./components/content-components/latex.js";
55
+ import { allComponents as ko } from "./components/content-components/all-components.js";
56
+ import { Home as wo } from "./components/content-components/home.js";
57
+ import { MobileNavTree as Lo } from "./components/nav-tree/mobile-nav.js";
58
+ import { rehypeCodeblocks as No } from "./plugins/rehype/rehype-code-blocks.js";
59
+ import { remarkHeadingIds as Oo } from "./plugins/remark/remark-heading-ids.js";
60
+ import { sanitizePreTags as zo } from "./plugins/sanitize/rehype-pre-to-mdx-fence.js";
61
+ import { rehypeCallouts as Xo } from "./plugins/sanitize/rehype-callouts.js";
62
+ import { rehypeParamName as Go } from "./plugins/sanitize/rehype-param-name.js";
63
+ import { rehypeTabs as Wo } from "./plugins/sanitize/rehype-tabs.js";
64
+ import { rehypeDetails as Ko } from "./plugins/sanitize/rehype-details.js";
65
+ import { rehypeHeadingIds as Uo } from "./plugins/sanitize/rehype-heading-ids.js";
66
+ import { rehypeZonePivots as Yo } from "./plugins/sanitize/rehype-zone-pivots.js";
67
+ import { mdxJsxFlowElementHandler as $o, rehypeRemark as er } from "./plugins/sanitize/rehype-remark.js";
68
+ import { rehypeLatex as rr } from "./plugins/sanitize/rehype-latex.js";
69
+ import { tableCellHandler as pr, tableHandler as mr, tableRowHandler as ar } from "./plugins/sanitize/rehype-table-align.js";
68
70
  export {
69
71
  fe as Api,
70
72
  ge as ApiExamples,
71
73
  ue as ApiFields,
72
74
  Be as ApiPlayground,
73
75
  Ae as ApiPlaygroundContext,
74
- Ge as ApiPlaygroundContextLegacy,
76
+ qe as ApiPlaygroundContextLegacy,
75
77
  T as ApiReferenceContext,
76
78
  b as ApiReferenceContext2,
77
79
  v as ApiReferenceProvider,
@@ -86,27 +88,28 @@ export {
86
88
  R as DocsConfigProvider,
87
89
  p as DocsLayout,
88
90
  r as DocsPage,
89
- We as EndpointFields,
91
+ Je as EndpointFields,
90
92
  be as EndpointHeader,
91
93
  Qe as Heading,
92
- ko as Home,
94
+ wo as Home,
95
+ Ro as LaTeX,
93
96
  Ve as Link,
94
97
  a as MDXRenderer,
95
- wo as MobileNavTree,
98
+ Lo as MobileNavTree,
96
99
  P as NavTree,
97
100
  ie as OperationPage,
98
101
  M as PageContext,
99
- E as PageContextMenu,
102
+ N as PageContextMenu,
100
103
  k as PageProvider,
101
104
  no as ParamName,
102
- I as PivotAwareTOC,
105
+ L as PivotAwareTOC,
103
106
  n as PlainTextPage,
104
- ye as Playground,
107
+ ce as Playground,
105
108
  se as SchemaPage,
106
109
  Po as Summary,
107
110
  so as Tab,
108
- co as Table,
109
- yo as TableBody,
111
+ yo as Table,
112
+ co as TableBody,
110
113
  To as TableCaption,
111
114
  bo as TableCell,
112
115
  vo as TableFooter,
@@ -119,8 +122,8 @@ export {
119
122
  po as ZonePivotProvider,
120
123
  ao as ZonePivotSelector,
121
124
  ro as ZoneTarget,
122
- Ne as addApiReferenceDataFromMdxAndDocsConfig,
123
- Ro as allComponents,
125
+ Ie as addApiReferenceDataFromMdxAndDocsConfig,
126
+ ko as allComponents,
124
127
  j as capitalize,
125
128
  Q as cn,
126
129
  ee as convertHtmlToMdx,
@@ -128,33 +131,34 @@ export {
128
131
  l as createDefaultComponents,
129
132
  i as defaultComponents,
130
133
  pe as extractHeadings,
131
- q as generateLlmsFullTxt,
132
- G as generateLlmsTxt,
134
+ X as generateLlmsFullTxt,
135
+ q as generateLlmsTxt,
133
136
  Ze as getApiReferenceDataFromGraph,
134
137
  V as getClassNames,
135
- W as getNodeText,
138
+ J as getNodeText,
136
139
  Z as getPageMarkdown,
137
140
  Y as getTextContent,
138
141
  _ as isElement,
139
- Yo as mdxJsxFlowElementHandler,
140
- Le as processSecurityOptions,
141
- zo as rehypeCallouts,
142
- Io as rehypeCodeblocks,
143
- Xo as rehypeDetails,
144
- Ko as rehypeHeadingIds,
145
- qo as rehypeParamName,
146
- _o as rehypeRemark,
142
+ $o as mdxJsxFlowElementHandler,
143
+ Ee as processSecurityOptions,
144
+ Xo as rehypeCallouts,
145
+ No as rehypeCodeblocks,
146
+ Ko as rehypeDetails,
147
+ Uo as rehypeHeadingIds,
148
+ rr as rehypeLatex,
149
+ Go as rehypeParamName,
150
+ er as rehypeRemark,
147
151
  ae as rehypeRemoveHtmlComments,
148
- Jo as rehypeTabs,
149
- Uo as rehypeZonePivots,
150
- Eo as remarkHeadingIds,
152
+ Wo as rehypeTabs,
153
+ Yo as rehypeZonePivots,
154
+ Oo as remarkHeadingIds,
151
155
  xe as removeHtmlComments,
152
- Oo as sanitizePreTags,
156
+ zo as sanitizePreTags,
153
157
  re as serializeMdx,
154
- er as tableCellHandler,
155
- or as tableHandler,
156
- rr as tableRowHandler,
157
- c as useApiReference,
158
+ pr as tableCellHandler,
159
+ mr as tableHandler,
160
+ ar as tableRowHandler,
161
+ y as useApiReference,
158
162
  C as useComponents,
159
163
  Fe as useCopyPathWithInputs,
160
164
  Se as useInitializeInputs,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,30 +1,31 @@
1
- import { unified as t } from "unified";
2
- import p from "rehype-parse";
1
+ import s from "rehype-parse";
2
+ import p from "remark-gfm";
3
3
  import i from "remark-mdx";
4
- import a from "remark-gfm";
5
- import f from "remark-stringify";
4
+ import a from "remark-stringify";
5
+ import { unified as f } from "unified";
6
6
  import { rehypeRemoveHtmlComments as u } from "../plugins/sanitize/remove-html-comments.js";
7
- import { sanitizePreTags as n } from "../plugins/sanitize/rehype-pre-to-mdx-fence.js";
7
+ import { rehypeLatex as n } from "../plugins/sanitize/rehype-latex.js";
8
+ import { sanitizePreTags as y } from "../plugins/sanitize/rehype-pre-to-mdx-fence.js";
8
9
  import { rehypeCallouts as c } from "../plugins/sanitize/rehype-callouts.js";
9
- import { rehypeParamName as y } from "../plugins/sanitize/rehype-param-name.js";
10
- import { rehypeTabs as h } from "../plugins/sanitize/rehype-tabs.js";
10
+ import { rehypeParamName as h } from "../plugins/sanitize/rehype-param-name.js";
11
+ import { rehypeTabs as x } from "../plugins/sanitize/rehype-tabs.js";
11
12
  import { rehypeDetails as d } from "../plugins/sanitize/rehype-details.js";
12
- import { rehypeHeadingIds as x } from "../plugins/sanitize/rehype-heading-ids.js";
13
- import { rehypeUnwrapImageLinks as l } from "../plugins/sanitize/rehype-unwrap-image-links.js";
14
- import { rehypeImageUrls as g } from "../plugins/sanitize/rehype-image-urls.js";
15
- import { rehypeZonePivots as k } from "../plugins/sanitize/rehype-zone-pivots.js";
16
- import { rehypeRemark as v } from "../plugins/sanitize/rehype-remark.js";
17
- async function O(m, r = {}) {
13
+ import { rehypeHeadingIds as l } from "../plugins/sanitize/rehype-heading-ids.js";
14
+ import { rehypeUnwrapImageLinks as g } from "../plugins/sanitize/rehype-unwrap-image-links.js";
15
+ import { rehypeImageUrls as k } from "../plugins/sanitize/rehype-image-urls.js";
16
+ import { rehypeZonePivots as v } from "../plugins/sanitize/rehype-zone-pivots.js";
17
+ import { rehypeRemark as P } from "../plugins/sanitize/rehype-remark.js";
18
+ async function j(m, r = {}) {
18
19
  const e = r.mdxExtracts || {}, o = {
19
20
  ...r,
20
21
  mdxExtracts: e
21
- }, s = await t().use(p).use(u).use(n).use(c).use(y).use(h).use(d).use(x).use(l).use(g, o).use(k, o).use(v).use(a).use(i).use(f).process(m);
22
+ }, t = await f().use(s).use(u).use(n).use(y).use(c).use(h).use(x).use(d).use(l).use(g).use(k, o).use(v, o).use(P).use(p).use(i).use(a).process(m);
22
23
  return {
23
- mdx: String(s),
24
+ mdx: String(t),
24
25
  mdxExtracts: e
25
26
  };
26
27
  }
27
28
  export {
28
- O as convertHtmlToMdx
29
+ j as convertHtmlToMdx
29
30
  };
30
31
  //# sourceMappingURL=convert-html-to-mdx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"convert-html-to-mdx.js","sources":["../../src/parser/convert-html-to-mdx.ts"],"sourcesContent":["import { unified } from \"unified\";\nimport rehypeParse from \"rehype-parse\";\nimport remarkMdx from \"remark-mdx\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkStringify from \"remark-stringify\";\nimport type { ConvertOptions, MdxExtracts } from \"../types\";\nimport {\n sanitizePreTags,\n rehypeCallouts,\n rehypeParamName,\n rehypeTabs,\n rehypeDetails,\n rehypeHeadingIds,\n rehypeZonePivots,\n rehypeRemark,\n rehypeImageUrls,\n rehypeUnwrapImageLinks,\n} from \"../plugins\";\nimport { rehypeRemoveHtmlComments } from \"../plugins/sanitize/remove-html-comments\";\n\nexport async function convertHtmlToMdx(\n html: string,\n options: ConvertOptions = {}\n): Promise<{ mdx: string; mdxExtracts: MdxExtracts }> {\n const mdxExtracts: MdxExtracts = options.mdxExtracts || {};\n\n const convertOptions: ConvertOptions = {\n ...options,\n mdxExtracts,\n };\n\n const processor = unified()\n .use(rehypeParse)\n .use(rehypeRemoveHtmlComments)\n .use(sanitizePreTags)\n .use(rehypeCallouts)\n .use(rehypeParamName)\n .use(rehypeTabs)\n .use(rehypeDetails)\n .use(rehypeHeadingIds)\n .use(rehypeUnwrapImageLinks)\n .use(rehypeImageUrls, convertOptions)\n .use(rehypeZonePivots, convertOptions)\n .use(rehypeRemark)\n .use(remarkGfm)\n .use(remarkMdx)\n .use(remarkStringify);\n\n const result = await processor.process(html);\n\n return {\n mdx: String(result),\n mdxExtracts,\n };\n}\n"],"names":["convertHtmlToMdx","html","options","mdxExtracts","convertOptions","result","unified","rehypeParse","rehypeRemoveHtmlComments","sanitizePreTags","rehypeCallouts","rehypeParamName","rehypeTabs","rehypeDetails","rehypeHeadingIds","rehypeUnwrapImageLinks","rehypeImageUrls","rehypeZonePivots","rehypeRemark","remarkGfm","remarkMdx","remarkStringify"],"mappings":";;;;;;;;;;;;;;;;AAoBA,eAAsBA,EACpBC,GACAC,IAA0B,IAC0B;AACpD,QAAMC,IAA2BD,EAAQ,eAAe,CAAA,GAElDE,IAAiC;AAAA,IACrC,GAAGF;AAAA,IACH,aAAAC;AAAA,EAAA,GAoBIE,IAAS,MAjBGC,IACf,IAAIC,CAAW,EACf,IAAIC,CAAwB,EAC5B,IAAIC,CAAe,EACnB,IAAIC,CAAc,EAClB,IAAIC,CAAe,EACnB,IAAIC,CAAU,EACd,IAAIC,CAAa,EACjB,IAAIC,CAAgB,EACpB,IAAIC,CAAsB,EAC1B,IAAIC,GAAiBZ,CAAc,EACnC,IAAIa,GAAkBb,CAAc,EACpC,IAAIc,CAAY,EAChB,IAAIC,CAAS,EACb,IAAIC,CAAS,EACb,IAAIC,CAAe,EAES,QAAQpB,CAAI;AAE3C,SAAO;AAAA,IACL,KAAK,OAAOI,CAAM;AAAA,IAClB,aAAAF;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"convert-html-to-mdx.js","sources":["../../src/parser/convert-html-to-mdx.ts"],"sourcesContent":["import rehypeParse from 'rehype-parse';\nimport remarkGfm from 'remark-gfm';\nimport remarkMath from 'remark-math';\nimport remarkMdx from 'remark-mdx';\nimport remarkStringify from 'remark-stringify';\nimport { unified } from 'unified';\n\nimport {\n sanitizePreTags,\n rehypeCallouts,\n rehypeParamName,\n rehypeTabs,\n rehypeDetails,\n rehypeHeadingIds,\n rehypeZonePivots,\n rehypeRemark,\n rehypeImageUrls,\n rehypeUnwrapImageLinks,\n rehypeLatex,\n} from '../plugins';\nimport { rehypeRemoveHtmlComments } from '../plugins/sanitize/remove-html-comments';\nimport type { ConvertOptions, MdxExtracts } from '../types';\n\nexport async function convertHtmlToMdx(\n html: string,\n options: ConvertOptions = {}\n): Promise<{ mdx: string; mdxExtracts: MdxExtracts }> {\n const mdxExtracts: MdxExtracts = options.mdxExtracts || {};\n\n const convertOptions: ConvertOptions = {\n ...options,\n mdxExtracts,\n };\n\n const processor = unified()\n .use(rehypeParse)\n .use(rehypeRemoveHtmlComments)\n .use(rehypeLatex)\n .use(sanitizePreTags)\n .use(rehypeCallouts)\n .use(rehypeParamName)\n .use(rehypeTabs)\n .use(rehypeDetails)\n .use(rehypeHeadingIds)\n .use(rehypeUnwrapImageLinks)\n .use(rehypeImageUrls, convertOptions)\n .use(rehypeZonePivots, convertOptions)\n .use(rehypeRemark)\n .use(remarkGfm)\n .use(remarkMdx)\n .use(remarkStringify);\n\n const result = await processor.process(html);\n\n return {\n mdx: String(result),\n mdxExtracts,\n };\n}\n"],"names":["convertHtmlToMdx","html","options","mdxExtracts","convertOptions","result","unified","rehypeParse","rehypeRemoveHtmlComments","rehypeLatex","sanitizePreTags","rehypeCallouts","rehypeParamName","rehypeTabs","rehypeDetails","rehypeHeadingIds","rehypeUnwrapImageLinks","rehypeImageUrls","rehypeZonePivots","rehypeRemark","remarkGfm","remarkMdx","remarkStringify"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,eAAsBA,EACpBC,GACAC,IAA0B,IAC0B;AACpD,QAAMC,IAA2BD,EAAQ,eAAe,CAAA,GAElDE,IAAiC;AAAA,IACrC,GAAGF;AAAA,IACH,aAAAC;AAAA,EAAA,GAqBIE,IAAS,MAlBGC,IACf,IAAIC,CAAW,EACf,IAAIC,CAAwB,EAC5B,IAAIC,CAAW,EACf,IAAIC,CAAe,EACnB,IAAIC,CAAc,EAClB,IAAIC,CAAe,EACnB,IAAIC,CAAU,EACd,IAAIC,CAAa,EACjB,IAAIC,CAAgB,EACpB,IAAIC,CAAsB,EAC1B,IAAIC,GAAiBb,CAAc,EACnC,IAAIc,GAAkBd,CAAc,EACpC,IAAIe,CAAY,EAChB,IAAIC,CAAS,EACb,IAAIC,CAAS,EACb,IAAIC,CAAe,EAES,QAAQrB,CAAI;AAE3C,SAAO;AAAA,IACL,KAAK,OAAOI,CAAM;AAAA,IAClB,aAAAF;AAAA,EAAA;AAEJ;"}
@@ -1,32 +1,34 @@
1
1
  import * as a from "react/jsx-runtime";
2
- import { jsx as s } from "react/jsx-runtime";
3
- import { compile as p, run as c } from "@mdx-js/mdx";
2
+ import { jsx as p } from "react/jsx-runtime";
3
+ import { compile as s, run as c } from "@mdx-js/mdx";
4
+ import f from "rehype-katex";
4
5
  import d from "remark-gfm";
5
- import { extractHeadings as f } from "../plugins/extract-headings.js";
6
- import { rehypeCodeblocks as l } from "../plugins/rehype/rehype-code-blocks.js";
7
- import { remarkHeadingIds as u } from "../plugins/remark/remark-heading-ids.js";
8
- import { defaultComponents as g } from "../components/content-components/default-components.js";
9
- async function H(t) {
6
+ import l from "remark-math";
7
+ import { extractHeadings as u } from "../plugins/extract-headings.js";
8
+ import { rehypeCodeblocks as g } from "../plugins/rehype/rehype-code-blocks.js";
9
+ import { remarkHeadingIds as h } from "../plugins/remark/remark-heading-ids.js";
10
+ import { defaultComponents as x } from "../components/content-components/default-components.js";
11
+ async function z(t) {
10
12
  var r;
11
13
  try {
12
- const o = await p(t, {
14
+ const o = await s(t, {
13
15
  outputFormat: "function-body",
14
- remarkPlugins: [d, u, f],
15
- rehypePlugins: [l]
16
- }), n = String(o), e = ((r = o.data) == null ? void 0 : r.headings) || [], { default: m } = await c(n, {
16
+ remarkPlugins: [d, l, h, u],
17
+ rehypePlugins: [f, g]
18
+ }), e = String(o), n = ((r = o.data) == null ? void 0 : r.headings) || [], { default: m } = await c(e, {
17
19
  ...a
18
20
  });
19
21
  return {
20
- Content: (i) => /* @__PURE__ */ s(
22
+ Content: (i) => /* @__PURE__ */ p(
21
23
  m,
22
24
  {
23
25
  ...i,
24
26
  components: {
25
- ...g
27
+ ...x
26
28
  }
27
29
  }
28
30
  ),
29
- headings: e
31
+ headings: n
30
32
  };
31
33
  } catch (o) {
32
34
  throw console.error(
@@ -36,6 +38,6 @@ async function H(t) {
36
38
  }
37
39
  }
38
40
  export {
39
- H as serializeMdx
41
+ z as serializeMdx
40
42
  };
41
43
  //# sourceMappingURL=serialize-mdx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"serialize-mdx.js","sources":["../../src/parser/serialize-mdx.tsx"],"sourcesContent":["import { compile } from \"@mdx-js/mdx\";\nimport { run } from \"@mdx-js/mdx\";\nimport * as runtime from \"react/jsx-runtime\";\nimport React from \"react\";\nimport remarkGfm from \"remark-gfm\";\nimport { rehypeCodeblocks, remarkHeadingIds } from \"../plugins\";\nimport { extractHeadings } from \"../plugins/extract-headings\";\nimport { defaultComponents } from \"../components\";\nimport type { TocItem } from \"../types\";\n\nexport interface SerializeMdxResult {\n Content: React.ComponentType;\n headings: TocItem[];\n}\n\nexport async function serializeMdx(\n mdxString: string\n): Promise<SerializeMdxResult> {\n try {\n const compiled = await compile(mdxString, {\n outputFormat: \"function-body\",\n remarkPlugins: [remarkGfm, remarkHeadingIds, extractHeadings],\n rehypePlugins: [rehypeCodeblocks],\n });\n\n const compiledMdx = String(compiled);\n\n const headings = (compiled.data?.headings as TocItem[]) || [];\n\n const { default: Content } = await run(compiledMdx, {\n ...runtime,\n });\n\n const Component = (props: Record<string, unknown>) => (\n <Content\n {...props}\n components={{\n ...defaultComponents,\n }}\n />\n );\n\n return {\n Content: Component,\n headings,\n };\n } catch (error) {\n console.error(\n \"MDX compilation failed:\",\n error instanceof Error ? error.message : String(error)\n );\n throw error;\n }\n}\n"],"names":["serializeMdx","mdxString","compiled","compile","remarkGfm","remarkHeadingIds","extractHeadings","rehypeCodeblocks","compiledMdx","headings","_a","Content","run","runtime","props","jsx","defaultComponents","error"],"mappings":";;;;;;;;AAeA,eAAsBA,EACpBC,GAC6B;;AAC7B,MAAI;AACF,UAAMC,IAAW,MAAMC,EAAQF,GAAW;AAAA,MACxC,cAAc;AAAA,MACd,eAAe,CAACG,GAAWC,GAAkBC,CAAe;AAAA,MAC5D,eAAe,CAACC,CAAgB;AAAA,IAAA,CACjC,GAEKC,IAAc,OAAON,CAAQ,GAE7BO,MAAYC,IAAAR,EAAS,SAAT,gBAAAQ,EAAe,aAA0B,CAAA,GAErD,EAAE,SAASC,EAAA,IAAY,MAAMC,EAAIJ,GAAa;AAAA,MAClD,GAAGK;AAAA,IAAA,CACJ;AAWD,WAAO;AAAA,MACL,SAVgB,CAACC,MACjB,gBAAAC;AAAA,QAACJ;AAAA,QAAA;AAAA,UACE,GAAGG;AAAA,UACJ,YAAY;AAAA,YACV,GAAGE;AAAA,UAAA;AAAA,QACL;AAAA,MAAA;AAAA,MAMF,UAAAP;AAAA,IAAA;AAAA,EAEJ,SAASQ,GAAO;AACd,kBAAQ;AAAA,MACN;AAAA,MACAA,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK;AAAA,IAAA,GAEjDA;AAAA,EACR;AACF;"}
1
+ {"version":3,"file":"serialize-mdx.js","sources":["../../src/parser/serialize-mdx.tsx"],"sourcesContent":["import { compile } from '@mdx-js/mdx';\nimport { run } from '@mdx-js/mdx';\nimport React from 'react';\nimport * as runtime from 'react/jsx-runtime';\nimport rehypeKatex from 'rehype-katex';\nimport remarkGfm from 'remark-gfm';\nimport remarkMath from 'remark-math';\n\nimport { defaultComponents } from '../components';\nimport { rehypeCodeblocks, remarkHeadingIds } from '../plugins';\nimport { extractHeadings } from '../plugins/extract-headings';\nimport type { TocItem } from '../types';\n\nexport interface SerializeMdxResult {\n Content: React.ComponentType;\n headings: TocItem[];\n}\n\nexport async function serializeMdx(mdxString: string): Promise<SerializeMdxResult> {\n try {\n const compiled = await compile(mdxString, {\n outputFormat: 'function-body',\n remarkPlugins: [remarkGfm, remarkMath, remarkHeadingIds, extractHeadings],\n rehypePlugins: [rehypeKatex, rehypeCodeblocks],\n });\n\n const compiledMdx = String(compiled);\n\n const headings = (compiled.data?.headings as TocItem[]) || [];\n\n const { default: Content } = await run(compiledMdx, {\n ...runtime,\n });\n\n const Component = (props: Record<string, unknown>) => (\n <Content\n {...props}\n components={{\n ...defaultComponents,\n }}\n />\n );\n\n return {\n Content: Component,\n headings,\n };\n } catch (error) {\n console.error(\n 'MDX compilation failed:',\n error instanceof Error ? error.message : String(error)\n );\n throw error;\n }\n}\n"],"names":["serializeMdx","mdxString","compiled","compile","remarkGfm","remarkMath","remarkHeadingIds","extractHeadings","rehypeKatex","rehypeCodeblocks","compiledMdx","headings","_a","Content","run","runtime","props","jsx","defaultComponents","error"],"mappings":";;;;;;;;;;AAkBA,eAAsBA,EAAaC,GAAgD;;AACjF,MAAI;AACF,UAAMC,IAAW,MAAMC,EAAQF,GAAW;AAAA,MACxC,cAAc;AAAA,MACd,eAAe,CAACG,GAAWC,GAAYC,GAAkBC,CAAe;AAAA,MACxE,eAAe,CAACC,GAAaC,CAAgB;AAAA,IAAA,CAC9C,GAEKC,IAAc,OAAOR,CAAQ,GAE7BS,MAAYC,IAAAV,EAAS,SAAT,gBAAAU,EAAe,aAA0B,CAAA,GAErD,EAAE,SAASC,EAAA,IAAY,MAAMC,EAAIJ,GAAa;AAAA,MAClD,GAAGK;AAAA,IAAA,CACJ;AAWD,WAAO;AAAA,MACL,SAVgB,CAACC,MACjB,gBAAAC;AAAA,QAACJ;AAAA,QAAA;AAAA,UACE,GAAGG;AAAA,UACJ,YAAY;AAAA,YACV,GAAGE;AAAA,UAAA;AAAA,QACL;AAAA,MAAA;AAAA,MAMF,UAAAP;AAAA,IAAA;AAAA,EAEJ,SAASQ,GAAO;AACd,kBAAQ;AAAA,MACN;AAAA,MACAA,aAAiB,QAAQA,EAAM,UAAU,OAAOA,CAAK;AAAA,IAAA,GAEjDA;AAAA,EACR;AACF;"}
@@ -0,0 +1,31 @@
1
+ import { visit as a } from "unist-util-visit";
2
+ import { isElement as l, getTextContent as s } from "../../utils/rehype.js";
3
+ function c(r) {
4
+ return r.replace(/\\\$/g, "$").replace(/\\\{/g, "{").replace(/\\\}/g, "}");
5
+ }
6
+ function i(r) {
7
+ return r.includes("$") || r.includes("$$");
8
+ }
9
+ function p(r) {
10
+ let e = r.replace(/^\$\$\s*/, "").replace(/\s*\$\$$/, "");
11
+ return e = e.replace(new RegExp("(?<!\\\\)#", "g"), "\\#").replace(new RegExp("(?<!\\\\)\\$", "g"), "\\$").replace(new RegExp("(?<!\\\\)%", "g"), "\\%").replace(new RegExp("(?<!\\\\)&", "g"), "\\&"), e;
12
+ }
13
+ const $ = () => (r) => {
14
+ a(r, (e) => {
15
+ if (e.type === "text") {
16
+ const t = e;
17
+ typeof t.value == "string" && (t.value.includes("\\$") || t.value.includes("\\{")) && (t.value = c(t.value));
18
+ }
19
+ if (l(e) && e.tagName === "p") {
20
+ const t = s(e).trim();
21
+ i(t) && t.match(/^\$\$[\s\S]*\$\$/) && (console.log(JSON.stringify(e, null, 2)), e.tagName = "LaTeX", e.properties = {
22
+ latex: p(t),
23
+ ...e.properties
24
+ }, delete e.properties.className);
25
+ }
26
+ });
27
+ };
28
+ export {
29
+ $ as rehypeLatex
30
+ };
31
+ //# sourceMappingURL=rehype-latex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rehype-latex.js","sources":["../../../src/plugins/sanitize/rehype-latex.ts"],"sourcesContent":["import type { Node, Text } from 'hast';\nimport type { Plugin } from 'unified';\nimport { visit } from 'unist-util-visit';\n\nimport { isElement, getTextContent } from '../../utils/rehype';\n\nfunction unescapeLatexDelimiters(text: string): string {\n return text.replace(/\\\\\\$/g, '$').replace(/\\\\\\{/g, '{').replace(/\\\\\\}/g, '}');\n}\n\nfunction hasLatexContent(text: string): boolean {\n return text.includes('$') || text.includes('$$');\n}\n\nfunction processLatexContent(text: string): string {\n // Remove $$ delimiters\n let processed = text.replace(/^\\$\\$\\s*/, '').replace(/\\s*\\$\\$$/, '');\n\n // Escape special characters for KaTeX (unless already escaped)\n // These are characters that have special meaning in LaTeX but might appear as literals in text\n processed = processed\n .replace(/(?<!\\\\)#/g, '\\\\#') // # in text like \"# training tokens\"\n .replace(/(?<!\\\\)\\$/g, '\\\\$') // $ in text like \"$1422.00\"\n .replace(/(?<!\\\\)%/g, '\\\\%') // % in text like \"50%\"\n .replace(/(?<!\\\\)&/g, '\\\\&'); // & in text like \"A & B\"\n\n return processed;\n}\n\nexport const rehypeLatex: Plugin<[], Node> = () => {\n return (tree) => {\n visit(tree, (node) => {\n if (node.type === 'text') {\n const textNode = node as Text;\n if (\n typeof textNode.value === 'string' &&\n (textNode.value.includes('\\\\$') || textNode.value.includes('\\\\{'))\n ) {\n textNode.value = unescapeLatexDelimiters(textNode.value);\n }\n }\n\n if (isElement(node) && node.tagName === 'p') {\n const textContent = getTextContent(node).trim();\n\n if (hasLatexContent(textContent) && textContent.match(/^\\$\\$[\\s\\S]*\\$\\$/)) {\n console.log(JSON.stringify(node, null, 2));\n\n node.tagName = 'LaTeX';\n node.properties = {\n latex: processLatexContent(textContent),\n ...node.properties,\n };\n delete node.properties.className;\n }\n }\n });\n };\n};\n"],"names":["unescapeLatexDelimiters","text","hasLatexContent","processLatexContent","processed","rehypeLatex","tree","visit","node","textNode","isElement","textContent","getTextContent"],"mappings":";;AAMA,SAASA,EAAwBC,GAAsB;AACrD,SAAOA,EAAK,QAAQ,SAAS,GAAG,EAAE,QAAQ,SAAS,GAAG,EAAE,QAAQ,SAAS,GAAG;AAC9E;AAEA,SAASC,EAAgBD,GAAuB;AAC9C,SAAOA,EAAK,SAAS,GAAG,KAAKA,EAAK,SAAS,IAAI;AACjD;AAEA,SAASE,EAAoBF,GAAsB;AAEjD,MAAIG,IAAYH,EAAK,QAAQ,YAAY,EAAE,EAAE,QAAQ,YAAY,EAAE;AAInE,SAAAG,IAAYA,EACT,QAAQ,WAAA,cAAA,GAAA,GAAa,KAAK,EAC1B,QAAQ,WAAA,gBAAA,GAAA,GAAc,KAAK,EAC3B,QAAQ,WAAA,cAAA,GAAA,GAAa,KAAK,EAC1B,QAAQ,WAAA,cAAA,MAAa,KAAK,GAEtBA;AACT;AAEO,MAAMC,IAAgC,MACpC,CAACC,MAAS;AACf,EAAAC,EAAMD,GAAM,CAACE,MAAS;AACpB,QAAIA,EAAK,SAAS,QAAQ;AACxB,YAAMC,IAAWD;AACjB,MACE,OAAOC,EAAS,SAAU,aACzBA,EAAS,MAAM,SAAS,KAAK,KAAKA,EAAS,MAAM,SAAS,KAAK,OAEhEA,EAAS,QAAQT,EAAwBS,EAAS,KAAK;AAAA,IAE3D;AAEA,QAAIC,EAAUF,CAAI,KAAKA,EAAK,YAAY,KAAK;AAC3C,YAAMG,IAAcC,EAAeJ,CAAI,EAAE,KAAA;AAEzC,MAAIN,EAAgBS,CAAW,KAAKA,EAAY,MAAM,kBAAkB,MACtE,QAAQ,IAAI,KAAK,UAAUH,GAAM,MAAM,CAAC,CAAC,GAEzCA,EAAK,UAAU,SACfA,EAAK,aAAa;AAAA,QAChB,OAAOL,EAAoBQ,CAAW;AAAA,QACtC,GAAGH,EAAK;AAAA,MAAA,GAEV,OAAOA,EAAK,WAAW;AAAA,IAE3B;AAAA,EACF,CAAC;AACH;"}
@@ -1,23 +1,23 @@
1
- import { visit as n } from "unist-util-visit";
1
+ import { visit as l } from "unist-util-visit";
2
2
  import { isElement as t } from "../../utils/rehype.js";
3
- const c = () => (p) => {
4
- n(p, (a) => {
5
- var o;
6
- if (!t(a) || !t(a, "tagName", "pre"))
3
+ const c = () => (i) => {
4
+ console.log("sanitizePreTags", JSON.stringify(i, null, 2)), l(i, (s) => {
5
+ var n;
6
+ if (!t(s) || !t(s, "tagName", "pre"))
7
7
  return;
8
- const e = a.children[0];
8
+ const e = s.children[0];
9
9
  if (!e || !t(e, "tagName", "code"))
10
10
  return;
11
- const i = (o = e.properties) == null ? void 0 : o.className;
12
- if (Array.isArray(i)) {
13
- for (const r of i)
11
+ const o = (n = e.properties) == null ? void 0 : n.className;
12
+ if (Array.isArray(o)) {
13
+ for (const r of o)
14
14
  if (typeof r == "string" && r.startsWith("lang-")) {
15
- const s = r.replace(/^lang-/, "");
16
- e.properties || (e.properties = {}), e.properties.className = [`language-${s}`];
15
+ const a = r.replace(/^lang-/, "");
16
+ e.properties || (e.properties = {}), e.properties.className = [`language-${a}`];
17
17
  break;
18
18
  } else if (typeof r == "string" && r.startsWith("language-")) {
19
- const s = r.replace(/^language-/, "");
20
- e.properties || (e.properties = {}), e.properties.className = [`language-${s}`];
19
+ const a = r.replace(/^language-/, "");
20
+ e.properties || (e.properties = {}), e.properties.className = [`language-${a}`];
21
21
  break;
22
22
  }
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rehype-pre-to-mdx-fence.js","sources":["../../../src/plugins/sanitize/rehype-pre-to-mdx-fence.ts"],"sourcesContent":["import { Plugin } from \"unified\";\nimport { Node, Element } from \"hast\";\nimport { visit } from \"unist-util-visit\";\nimport { isElement } from \"../../utils/rehype\";\n\nexport const sanitizePreTags: Plugin<[], Node> = () => {\n return (tree) => {\n visit(tree, (node) => {\n if (!isElement(node) || !isElement(node, \"tagName\", \"pre\")) {\n return;\n }\n\n const code = node.children[0] as Element | undefined;\n if (!code || !isElement(code, \"tagName\", \"code\")) {\n return;\n }\n\n const className = code.properties?.className;\n if (Array.isArray(className)) {\n for (const cls of className) {\n if (typeof cls === \"string\" && cls.startsWith(\"lang-\")) {\n const lang = cls.replace(/^lang-/, \"\");\n if (!code.properties) code.properties = {};\n code.properties.className = [`language-${lang}`];\n break;\n } else if (typeof cls === \"string\" && cls.startsWith(\"language-\")) {\n const lang = cls.replace(/^language-/, \"\");\n if (!code.properties) code.properties = {};\n code.properties.className = [`language-${lang}`];\n break;\n }\n }\n }\n });\n };\n};\n"],"names":["sanitizePreTags","tree","visit","node","isElement","code","className","_a","cls","lang"],"mappings":";;AAKO,MAAMA,IAAoC,MACxC,CAACC,MAAS;AACf,EAAAC,EAAMD,GAAM,CAACE,MAAS;;AACpB,QAAI,CAACC,EAAUD,CAAI,KAAK,CAACC,EAAUD,GAAM,WAAW,KAAK;AACvD;AAGF,UAAME,IAAOF,EAAK,SAAS,CAAC;AAC5B,QAAI,CAACE,KAAQ,CAACD,EAAUC,GAAM,WAAW,MAAM;AAC7C;AAGF,UAAMC,KAAYC,IAAAF,EAAK,eAAL,gBAAAE,EAAiB;AACnC,QAAI,MAAM,QAAQD,CAAS;AACzB,iBAAWE,KAAOF;AAChB,YAAI,OAAOE,KAAQ,YAAYA,EAAI,WAAW,OAAO,GAAG;AACtD,gBAAMC,IAAOD,EAAI,QAAQ,UAAU,EAAE;AACrC,UAAKH,EAAK,eAAYA,EAAK,aAAa,CAAA,IACxCA,EAAK,WAAW,YAAY,CAAC,YAAYI,CAAI,EAAE;AAC/C;AAAA,QACF,WAAW,OAAOD,KAAQ,YAAYA,EAAI,WAAW,WAAW,GAAG;AACjE,gBAAMC,IAAOD,EAAI,QAAQ,cAAc,EAAE;AACzC,UAAKH,EAAK,eAAYA,EAAK,aAAa,CAAA,IACxCA,EAAK,WAAW,YAAY,CAAC,YAAYI,CAAI,EAAE;AAC/C;AAAA,QACF;AAAA;AAAA,EAGN,CAAC;AACH;"}
1
+ {"version":3,"file":"rehype-pre-to-mdx-fence.js","sources":["../../../src/plugins/sanitize/rehype-pre-to-mdx-fence.ts"],"sourcesContent":["import { Node, Element } from 'hast';\nimport { Plugin } from 'unified';\nimport { visit } from 'unist-util-visit';\n\nimport { isElement } from '../../utils/rehype';\n\nexport const sanitizePreTags: Plugin<[], Node> = () => {\n return (tree) => {\n console.log('sanitizePreTags', JSON.stringify(tree, null, 2));\n\n visit(tree, (node) => {\n if (!isElement(node) || !isElement(node, 'tagName', 'pre')) {\n return;\n }\n\n const code = node.children[0] as Element | undefined;\n if (!code || !isElement(code, 'tagName', 'code')) {\n return;\n }\n\n const className = code.properties?.className;\n if (Array.isArray(className)) {\n for (const cls of className) {\n if (typeof cls === 'string' && cls.startsWith('lang-')) {\n const lang = cls.replace(/^lang-/, '');\n if (!code.properties) code.properties = {};\n code.properties.className = [`language-${lang}`];\n break;\n } else if (typeof cls === 'string' && cls.startsWith('language-')) {\n const lang = cls.replace(/^language-/, '');\n if (!code.properties) code.properties = {};\n code.properties.className = [`language-${lang}`];\n break;\n }\n }\n }\n });\n };\n};\n"],"names":["sanitizePreTags","tree","visit","node","isElement","code","className","_a","cls","lang"],"mappings":";;AAMO,MAAMA,IAAoC,MACxC,CAACC,MAAS;AACf,UAAQ,IAAI,mBAAmB,KAAK,UAAUA,GAAM,MAAM,CAAC,CAAC,GAE5DC,EAAMD,GAAM,CAACE,MAAS;;AACpB,QAAI,CAACC,EAAUD,CAAI,KAAK,CAACC,EAAUD,GAAM,WAAW,KAAK;AACvD;AAGF,UAAME,IAAOF,EAAK,SAAS,CAAC;AAC5B,QAAI,CAACE,KAAQ,CAACD,EAAUC,GAAM,WAAW,MAAM;AAC7C;AAGF,UAAMC,KAAYC,IAAAF,EAAK,eAAL,gBAAAE,EAAiB;AACnC,QAAI,MAAM,QAAQD,CAAS;AACzB,iBAAWE,KAAOF;AAChB,YAAI,OAAOE,KAAQ,YAAYA,EAAI,WAAW,OAAO,GAAG;AACtD,gBAAMC,IAAOD,EAAI,QAAQ,UAAU,EAAE;AACrC,UAAKH,EAAK,eAAYA,EAAK,aAAa,CAAA,IACxCA,EAAK,WAAW,YAAY,CAAC,YAAYI,CAAI,EAAE;AAC/C;AAAA,QACF,WAAW,OAAOD,KAAQ,YAAYA,EAAI,WAAW,WAAW,GAAG;AACjE,gBAAMC,IAAOD,EAAI,QAAQ,cAAc,EAAE;AACzC,UAAKH,EAAK,eAAYA,EAAK,aAAa,CAAA,IACxCA,EAAK,WAAW,YAAY,CAAC,YAAYI,CAAI,EAAE;AAC/C;AAAA,QACF;AAAA;AAAA,EAGN,CAAC;AACH;"}
@@ -18,7 +18,8 @@ const d = [
18
18
  "Tabs",
19
19
  "Tab",
20
20
  "Details",
21
- "Summary"
21
+ "Summary",
22
+ "LaTeX"
22
23
  ], f = [...d, ...u];
23
24
  function o(e, t) {
24
25
  const a = t.children ? e.all(t) : [];
@@ -33,7 +34,7 @@ function o(e, t) {
33
34
  children: a
34
35
  };
35
36
  }
36
- function x() {
37
+ function b() {
37
38
  const e = { ...m };
38
39
  for (const t of f)
39
40
  e[t] = o;
@@ -45,6 +46,6 @@ function x() {
45
46
  }
46
47
  export {
47
48
  o as mdxJsxFlowElementHandler,
48
- x as rehypeRemark
49
+ b as rehypeRemark
49
50
  };
50
51
  //# sourceMappingURL=rehype-remark.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rehype-remark.js","sources":["../../../src/plugins/sanitize/rehype-remark.ts"],"sourcesContent":["import { MdxJsxFlowElement } from \"mdast-util-mdx-jsx\";\nimport type { Root as HastRoot, Element } from \"hast\";\nimport { toMdast, defaultHandlers } from \"hast-util-to-mdast\";\nimport type { State, Handle } from \"hast-util-to-mdast\";\nimport type { Root as MdastRoot } from \"mdast\";\nimport type { BlockContent, DefinitionContent } from \"mdast\";\nimport {\n tableHandler,\n tableRowHandler,\n tableCellHandler,\n} from \"./rehype-table-align\";\n\nconst HTML_TAGS = [\n \"iframe\",\n \"video\",\n \"audio\",\n \"svg\",\n \"figure\",\n \"figcaption\",\n \"canvas\",\n \"form\",\n \"input\",\n];\nconst COMPONENT_NAMES = [\n \"Callout\",\n \"ZonePivot\",\n \"ZoneTarget\",\n \"ParamName\",\n \"Tabs\",\n \"Tab\",\n \"Details\",\n \"Summary\",\n];\nconst ALLOWED_COMPONENTS = [...HTML_TAGS, ...COMPONENT_NAMES];\n\nexport function mdxJsxFlowElementHandler(\n state: State,\n node: Element\n): MdxJsxFlowElement {\n const children = node.children\n ? (state.all(node) as Array<BlockContent | DefinitionContent>)\n : [];\n\n return {\n type: \"mdxJsxFlowElement\",\n name: node.tagName,\n attributes: Object.entries(node.properties ?? {}).map(([key, value]) => ({\n type: \"mdxJsxAttribute\",\n name: key,\n value: Array.isArray(value) ? value.join(\" \") : (value as string),\n })),\n children,\n };\n}\n\nexport function rehypeRemark() {\n const handlers: Record<string, Handle> = { ...defaultHandlers };\n\n for (const name of ALLOWED_COMPONENTS) {\n handlers[name] = mdxJsxFlowElementHandler;\n }\n handlers.mdxJsxFlowElement = mdxJsxFlowElementHandler;\n\n handlers.table = tableHandler;\n handlers.tr = tableRowHandler;\n handlers.th = tableCellHandler;\n handlers.td = tableCellHandler;\n\n return function (tree: HastRoot) {\n const newTree = toMdast(tree, {\n handlers,\n }) as MdastRoot;\n return newTree;\n };\n}\n"],"names":["HTML_TAGS","COMPONENT_NAMES","ALLOWED_COMPONENTS","mdxJsxFlowElementHandler","state","node","children","key","value","rehypeRemark","handlers","defaultHandlers","name","tableHandler","tableRowHandler","tableCellHandler","tree","toMdast"],"mappings":";;AAYA,MAAMA,IAAY;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACMC,IAAkB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACMC,IAAqB,CAAC,GAAGF,GAAW,GAAGC,CAAe;AAErD,SAASE,EACdC,GACAC,GACmB;AACnB,QAAMC,IAAWD,EAAK,WACjBD,EAAM,IAAIC,CAAI,IACf,CAAA;AAEJ,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAMA,EAAK;AAAA,IACX,YAAY,OAAO,QAAQA,EAAK,cAAc,EAAE,EAAE,IAAI,CAAC,CAACE,GAAKC,CAAK,OAAO;AAAA,MACvE,MAAM;AAAA,MACN,MAAMD;AAAA,MACN,OAAO,MAAM,QAAQC,CAAK,IAAIA,EAAM,KAAK,GAAG,IAAKA;AAAA,IAAA,EACjD;AAAA,IACF,UAAAF;AAAA,EAAA;AAEJ;AAEO,SAASG,IAAe;AAC7B,QAAMC,IAAmC,EAAE,GAAGC,EAAA;AAE9C,aAAWC,KAAQV;AACjB,IAAAQ,EAASE,CAAI,IAAIT;AAEnB,SAAAO,EAAS,oBAAoBP,GAE7BO,EAAS,QAAQG,GACjBH,EAAS,KAAKI,GACdJ,EAAS,KAAKK,GACdL,EAAS,KAAKK,GAEP,SAAUC,GAAgB;AAI/B,WAHgBC,EAAQD,GAAM;AAAA,MAC5B,UAAAN;AAAA,IAAA,CACD;AAAA,EAEH;AACF;"}
1
+ {"version":3,"file":"rehype-remark.js","sources":["../../../src/plugins/sanitize/rehype-remark.ts"],"sourcesContent":["import type { Root as HastRoot, Element } from 'hast';\nimport { toMdast, defaultHandlers } from 'hast-util-to-mdast';\nimport type { State, Handle } from 'hast-util-to-mdast';\nimport type { Root as MdastRoot } from 'mdast';\nimport type { BlockContent, DefinitionContent } from 'mdast';\nimport { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';\n\nimport { tableHandler, tableRowHandler, tableCellHandler } from './rehype-table-align';\n\nconst HTML_TAGS = [\n 'iframe',\n 'video',\n 'audio',\n 'svg',\n 'figure',\n 'figcaption',\n 'canvas',\n 'form',\n 'input',\n];\nconst COMPONENT_NAMES = [\n 'Callout',\n 'ZonePivot',\n 'ZoneTarget',\n 'ParamName',\n 'Tabs',\n 'Tab',\n 'Details',\n 'Summary',\n 'LaTeX',\n];\nconst ALLOWED_COMPONENTS = [...HTML_TAGS, ...COMPONENT_NAMES];\n\nexport function mdxJsxFlowElementHandler(state: State, node: Element): MdxJsxFlowElement {\n const children = node.children\n ? (state.all(node) as Array<BlockContent | DefinitionContent>)\n : [];\n\n return {\n type: 'mdxJsxFlowElement',\n name: node.tagName,\n attributes: Object.entries(node.properties ?? {}).map(([key, value]) => ({\n type: 'mdxJsxAttribute',\n name: key,\n value: Array.isArray(value) ? value.join(' ') : (value as string),\n })),\n children,\n };\n}\n\nexport function rehypeRemark() {\n const handlers: Record<string, Handle> = { ...defaultHandlers };\n\n for (const name of ALLOWED_COMPONENTS) {\n handlers[name] = mdxJsxFlowElementHandler;\n }\n handlers.mdxJsxFlowElement = mdxJsxFlowElementHandler;\n\n handlers.table = tableHandler;\n handlers.tr = tableRowHandler;\n handlers.th = tableCellHandler;\n handlers.td = tableCellHandler;\n\n return function (tree: HastRoot) {\n const newTree = toMdast(tree, {\n handlers,\n }) as MdastRoot;\n return newTree;\n };\n}\n"],"names":["HTML_TAGS","COMPONENT_NAMES","ALLOWED_COMPONENTS","mdxJsxFlowElementHandler","state","node","children","key","value","rehypeRemark","handlers","defaultHandlers","name","tableHandler","tableRowHandler","tableCellHandler","tree","toMdast"],"mappings":";;AASA,MAAMA,IAAY;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACMC,IAAkB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GACMC,IAAqB,CAAC,GAAGF,GAAW,GAAGC,CAAe;AAErD,SAASE,EAAyBC,GAAcC,GAAkC;AACvF,QAAMC,IAAWD,EAAK,WACjBD,EAAM,IAAIC,CAAI,IACf,CAAA;AAEJ,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAMA,EAAK;AAAA,IACX,YAAY,OAAO,QAAQA,EAAK,cAAc,EAAE,EAAE,IAAI,CAAC,CAACE,GAAKC,CAAK,OAAO;AAAA,MACvE,MAAM;AAAA,MACN,MAAMD;AAAA,MACN,OAAO,MAAM,QAAQC,CAAK,IAAIA,EAAM,KAAK,GAAG,IAAKA;AAAA,IAAA,EACjD;AAAA,IACF,UAAAF;AAAA,EAAA;AAEJ;AAEO,SAASG,IAAe;AAC7B,QAAMC,IAAmC,EAAE,GAAGC,EAAA;AAE9C,aAAWC,KAAQV;AACjB,IAAAQ,EAASE,CAAI,IAAIT;AAEnB,SAAAO,EAAS,oBAAoBP,GAE7BO,EAAS,QAAQG,GACjBH,EAAS,KAAKI,GACdJ,EAAS,KAAKK,GACdL,EAAS,KAAKK,GAEP,SAAUC,GAAgB;AAI/B,WAHgBC,EAAQD,GAAM;AAAA,MAC5B,UAAAN;AAAA,IAAA,CACD;AAAA,EAEH;AACF;"}