@aiquants/markdown 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/{abnfDiagram-VRR7QNED-DL9JJfMF.cjs → abnfDiagram-VRR7QNED-CfVjEUzG.cjs} +1 -1
- package/dist/{abnfDiagram-VRR7QNED-utxwo7Ri.js → abnfDiagram-VRR7QNED-DeHJ63Vu.js} +3 -3
- package/dist/{arc-Byq9kr_0.js → arc-DH6k2JIR.js} +1 -1
- package/dist/{arc-BY7loL0l.cjs → arc-XFFLkHkK.cjs} +1 -1
- package/dist/{architectureDiagram-ZJ3FMSHR-CLLwinmD.cjs → architectureDiagram-ZJ3FMSHR-7xJ6YYGu.cjs} +1 -1
- package/dist/{architectureDiagram-ZJ3FMSHR-DpnBy_s1.js → architectureDiagram-ZJ3FMSHR-CQ1m3MUB.js} +2 -2
- package/dist/{blockDiagram-677ZJIJ3-C8dybZZU.js → blockDiagram-677ZJIJ3-BPC3se0e.js} +3 -3
- package/dist/{blockDiagram-677ZJIJ3-Cs5tpWQ-.cjs → blockDiagram-677ZJIJ3-CJOFqwiW.cjs} +1 -1
- package/dist/{c4Diagram-LMCZKHZV-3aG0bDyP.js → c4Diagram-LMCZKHZV-BEIrp4t6.js} +2 -2
- package/dist/{c4Diagram-LMCZKHZV-B-rz2a3v.cjs → c4Diagram-LMCZKHZV-D8ytYGhR.cjs} +1 -1
- package/dist/{channel-Dn2hPSB8.cjs → channel-CJQcZr8o.cjs} +1 -1
- package/dist/{channel-BoXFYC1g.js → channel-DoH_tsOQ.js} +1 -1
- package/dist/{chunk-2Q5K7J3B-B7QkO_05.cjs → chunk-2Q5K7J3B-BbMQR3Sm.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-CYpyj9EA.js → chunk-2Q5K7J3B-l8ly7Yjr.js} +1 -1
- package/dist/{chunk-32BRIVSS-DcLe6F1l.js → chunk-32BRIVSS-BhQJBlVw.js} +1 -1
- package/dist/{chunk-32BRIVSS-BjI5igEa.cjs → chunk-32BRIVSS-BwDfmprN.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-C4ILSCRb.js → chunk-5VM5RSS4-Bfis-x7E.js} +1 -1
- package/dist/{chunk-5VM5RSS4-DafQyxAv.cjs → chunk-5VM5RSS4-CqDQlS7v.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-BXZDK2R1.cjs → chunk-EX3LRPZG-9aDULZwJ.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-CTaiVHYY.js → chunk-EX3LRPZG-DUTbzwDM.js} +4 -4
- package/dist/{chunk-JWPE2WC7-CNZBI1Pb.cjs → chunk-JWPE2WC7-5cM5nFf6.cjs} +1 -1
- package/dist/{chunk-JWPE2WC7-B-nuuS4b.js → chunk-JWPE2WC7-DpcSSOP5.js} +1 -1
- package/dist/{chunk-MOJQB5TN-Dh_1HfSC.cjs → chunk-MOJQB5TN-Cw864mUL.cjs} +1 -1
- package/dist/{chunk-MOJQB5TN-D1oF99aM.js → chunk-MOJQB5TN-D_h6bolU.js} +1 -1
- package/dist/{chunk-PUDLZKDR-CPadtN2C.js → chunk-PUDLZKDR-B0wZjmzv.js} +6 -6
- package/dist/{chunk-PUDLZKDR-CMFJFweY.cjs → chunk-PUDLZKDR-yLvT3c9x.cjs} +1 -1
- package/dist/{chunk-RYQCIY6F-DxuegR0d.js → chunk-RYQCIY6F-DTKYsCgk.js} +1 -1
- package/dist/{chunk-RYQCIY6F-C6453DQl.cjs → chunk-RYQCIY6F-hj9dRWMT.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-ziE5DrnY.js → chunk-V7JOEXUC-COa9uddv.js} +5 -5
- package/dist/{chunk-V7JOEXUC-l9PaMPOT.cjs → chunk-V7JOEXUC-DIQ8n1AN.cjs} +1 -1
- package/dist/{chunk-VR4S4FIN-BiCYvwb8.js → chunk-VR4S4FIN-B72PxPVm.js} +1 -1
- package/dist/{chunk-VR4S4FIN-CCCnXTuJ.cjs → chunk-VR4S4FIN-Cy-2mZJB.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-BFKT7vFo.js → chunk-XXDRQBXY-D2Sgptl-.js} +1 -1
- package/dist/{chunk-XXDRQBXY-D5IbqpUM.cjs → chunk-XXDRQBXY-DmoUE7-y.cjs} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-KA_F_TBQ.js → classDiagram-OUVF2IWQ-Dah4_VL7.js} +2 -2
- package/dist/{classDiagram-OUVF2IWQ-C1AZm4pB.cjs → classDiagram-OUVF2IWQ-GjsCEuKI.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-KA_F_TBQ.js → classDiagram-v2-EOCWNBFH-Dah4_VL7.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-C1AZm4pB.cjs → classDiagram-v2-EOCWNBFH-GjsCEuKI.cjs} +1 -1
- package/dist/components/MarkdownRenderer.d.ts +1 -1
- package/dist/{cose-bilkent-JH36ORCC-B_16TV-v.js → cose-bilkent-JH36ORCC-Pi0l3C5o.js} +1 -1
- package/dist/{cose-bilkent-JH36ORCC-BQ2K2GyI.cjs → cose-bilkent-JH36ORCC-Vi9pHFwc.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-Dq7UoRYB.cjs → cynefinDiagram-TSTJHNR4-BQ2k9Z6b.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-DTV6ORFc.js → cynefinDiagram-TSTJHNR4-CIh03JTU.js} +2 -2
- package/dist/{dagre-VKFMJZFB-PCi8s-PP.cjs → dagre-VKFMJZFB-DI2wSrAy.cjs} +1 -1
- package/dist/{dagre-VKFMJZFB-kSrm5dp4.js → dagre-VKFMJZFB-cINcPwV3.js} +2 -2
- package/dist/{diagram-FQU43EPY-wTUTIyQQ.cjs → diagram-FQU43EPY-B6iUH2l5.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-D3dKlAPv.js → diagram-FQU43EPY-BonrBTG_.js} +2 -2
- package/dist/{diagram-G47NLZAW-HJlhMCYj.js → diagram-G47NLZAW-5N876QQA.js} +3 -3
- package/dist/{diagram-G47NLZAW-_4FrgCGJ.cjs → diagram-G47NLZAW-CY6mWS2R.cjs} +1 -1
- package/dist/{diagram-NH7WQ7WH-CgeHmdJL.js → diagram-NH7WQ7WH-LFuTbHxY.js} +2 -2
- package/dist/{diagram-NH7WQ7WH-ByCeah-n.cjs → diagram-NH7WQ7WH-x3SaRfd6.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-C0IhePjD.cjs → diagram-OA4YK3LP-B9mVw8cB.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-CwJcZGHD.js → diagram-OA4YK3LP-Cinpbl0B.js} +3 -3
- package/dist/{diagram-WEI45ONY-Cf-TVNEb.cjs → diagram-WEI45ONY-BRYVUhRr.cjs} +1 -1
- package/dist/{diagram-WEI45ONY-v1LUmWAx.js → diagram-WEI45ONY-HPCHpafe.js} +2 -2
- package/dist/{ebnfDiagram-CCIWWBDH-k5XOUGml.cjs → ebnfDiagram-CCIWWBDH-DhFlIi0a.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-DqZtnwGP.js → ebnfDiagram-CCIWWBDH-oLOdtH39.js} +3 -3
- package/dist/{erDiagram-Q63AITRT-D6kP6d5J.js → erDiagram-Q63AITRT-CCtzpK78.js} +4 -4
- package/dist/{erDiagram-Q63AITRT-DFet1VTy.cjs → erDiagram-Q63AITRT-DCCFR1Ai.cjs} +1 -1
- package/dist/{extractHeadings-B2I83li5.js → extractHeadings-CGJexznE.js} +42 -42
- package/dist/{extractHeadings-R7NxLZJP.cjs → extractHeadings-lDHB2sBb.cjs} +3 -3
- package/dist/flowDiagram-23GEKE2U-ORytlvmX.js +7 -0
- package/dist/flowDiagram-23GEKE2U-h2WZTCCn.cjs +1 -0
- package/dist/{ganttDiagram-NO4QXBWP-CEQqLRYx.cjs → ganttDiagram-NO4QXBWP-C9RPyo4r.cjs} +1 -1
- package/dist/{ganttDiagram-NO4QXBWP-I9DxJwkX.js → ganttDiagram-NO4QXBWP-Dfi3nINO.js} +2 -2
- package/dist/{gitGraphDiagram-IHSO6WYX-p_7WQssC.js → gitGraphDiagram-IHSO6WYX-CjAqPhww.js} +3 -3
- package/dist/{gitGraphDiagram-IHSO6WYX-yyEwsmHH.cjs → gitGraphDiagram-IHSO6WYX-mT3NNT7T.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.server.js +7 -7
- package/dist/{infoDiagram-FWYZ7A6U-BFCkTfAI.cjs → infoDiagram-FWYZ7A6U-0Co9BitR.cjs} +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-C9L5rIcg.js → infoDiagram-FWYZ7A6U-BXWQ9Vy4.js} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-B3TjOzka.cjs → ishikawaDiagram-FXEZZL3T-BKqUBw1i.cjs} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-uxcpJtLF.js → ishikawaDiagram-FXEZZL3T-CZp5P1WE.js} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-CvtPgaNR.cjs → journeyDiagram-5HDEW3XC-CeumPQ1I.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-DMq3piuW.js → journeyDiagram-5HDEW3XC-DYVTgOOE.js} +4 -4
- package/dist/{kanban-definition-HUTT4EX6-DJ9sXiRP.cjs → kanban-definition-HUTT4EX6-Cg5KnsE9.cjs} +1 -1
- package/dist/{kanban-definition-HUTT4EX6-Dfal8jdL.js → kanban-definition-HUTT4EX6-CnleRy80.js} +2 -2
- package/dist/{linear-CvzPdVAO.js → linear-Cf8i6Rsk.js} +1 -1
- package/dist/{linear-CLykHvhQ.cjs → linear-qqwu6T0F.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-CErimIK1.cjs → mindmap-definition-LN4V7U3C-DfFWeFph.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-C8erO2Mh.js → mindmap-definition-LN4V7U3C-lBin9VOm.js} +3 -3
- package/dist/{pegDiagram-2B236MQR-CECcXaCN.js → pegDiagram-2B236MQR-BiD21lOj.js} +3 -3
- package/dist/{pegDiagram-2B236MQR-DBL8X0k9.cjs → pegDiagram-2B236MQR-Cf1f-3yi.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-CWlf16nv.js → pieDiagram-ENE6RG2P-BqZb6gaV.js} +3 -3
- package/dist/{pieDiagram-ENE6RG2P-B_-x0Nvj.cjs → pieDiagram-ENE6RG2P-jwhVsZgX.cjs} +1 -1
- package/dist/{quadrantDiagram-ABIIQ3AL-JpouSW89.js → quadrantDiagram-ABIIQ3AL-CNe9fRLO.js} +2 -2
- package/dist/{quadrantDiagram-ABIIQ3AL-HKlopKX4.cjs → quadrantDiagram-ABIIQ3AL-sO_sIA7b.cjs} +1 -1
- package/dist/{railroadDiagram-RFXS5EU6-CLTBEsir.js → railroadDiagram-RFXS5EU6-53YTkJrs.js} +3 -3
- package/dist/{railroadDiagram-RFXS5EU6-B-v61EFn.cjs → railroadDiagram-RFXS5EU6-Dkc8k3e9.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-4vCejkrF.cjs → requirementDiagram-TGXJPOKE-C0GMlJO4.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-DtoTpDLe.js → requirementDiagram-TGXJPOKE-D8Gz7jzA.js} +3 -3
- package/dist/{sankeyDiagram-HTMAVEWB-Bp8p_ojk.cjs → sankeyDiagram-HTMAVEWB-Bw9J2Ay2.cjs} +1 -1
- package/dist/{sankeyDiagram-HTMAVEWB-WxnjUz1I.js → sankeyDiagram-HTMAVEWB-CEC0GaCg.js} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-BUPaWSIG.cjs → sequenceDiagram-DBY2YBRQ-BuqPCreB.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-DGJcC2MQ.js → sequenceDiagram-DBY2YBRQ-CKb4m3I0.js} +3 -3
- package/dist/{sizeCapture-X5ZJPWSS-BmP0pJAx.js → sizeCapture-X5ZJPWSS-CotnTNAA.js} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-Dk82fAT8.cjs → sizeCapture-X5ZJPWSS-Dm3rsxXw.cjs} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-CL5Omkqs.cjs → stateDiagram-2N3HPSRC-5Y-OlePe.cjs} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-ZL_eFTbb.js → stateDiagram-2N3HPSRC-GWEIP-C9.js} +2 -2
- package/dist/{stateDiagram-v2-6OUMAXLB-BgOqjiSL.js → stateDiagram-v2-6OUMAXLB-BZFV8swJ.js} +2 -2
- package/dist/{stateDiagram-v2-6OUMAXLB-D3Zgp8xl.cjs → stateDiagram-v2-6OUMAXLB-v77D3Qyf.cjs} +1 -1
- package/dist/{swimlanes-5IMT3BWC-CuW1KWfs.cjs → swimlanes-5IMT3BWC-B1hLl8Ph.cjs} +1 -1
- package/dist/{swimlanes-5IMT3BWC-GB1p75ou.js → swimlanes-5IMT3BWC-DujAOwAt.js} +3 -3
- package/dist/{swimlanesDiagram-G3AALYLV-Jr2ZWz3z.js → swimlanesDiagram-G3AALYLV-B-5z3jDg.js} +2 -2
- package/dist/{swimlanesDiagram-G3AALYLV-Di_Nug7g.cjs → swimlanesDiagram-G3AALYLV-Cklgsxbg.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-BKVe7Qad.cjs → timeline-definition-FHXFAJF6-B2m-aQLI.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-663e-yVA.js → timeline-definition-FHXFAJF6-Fmzt_lvR.js} +2 -2
- package/dist/{vennDiagram-L72KCM5P-2NIIKtsl.cjs → vennDiagram-L72KCM5P-rL7UDYbl.cjs} +1 -1
- package/dist/{vennDiagram-L72KCM5P-BDGC8Vm3.js → vennDiagram-L72KCM5P-zIXK42Cx.js} +1 -1
- package/dist/{wardleyDiagram-EHGQE667-BrTNZSmG.cjs → wardleyDiagram-EHGQE667-CNLieFen.cjs} +1 -1
- package/dist/{wardleyDiagram-EHGQE667-IbGr9hGV.js → wardleyDiagram-EHGQE667-pTeeZ0uM.js} +2 -2
- package/dist/{xychartDiagram-FW5EYKEG-CbxKOQYO.js → xychartDiagram-FW5EYKEG-B6UdSSVZ.js} +2 -2
- package/dist/{xychartDiagram-FW5EYKEG-MCkmgF8g.cjs → xychartDiagram-FW5EYKEG-CD5ik4HK.cjs} +1 -1
- package/package.json +8 -7
- package/dist/flowDiagram-23GEKE2U-BTXvBdte.js +0 -7
- package/dist/flowDiagram-23GEKE2U-C81VZYM7.cjs +0 -1
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ const parseResult = await parseMarkdown(
|
|
|
126
126
|
deniedPathSegments: hostDenyRules, // required; [] denies nothing
|
|
127
127
|
maxHtmlBytes: 4 * 1024 * 1024, // required; the largest HTML in bytes
|
|
128
128
|
resolveImports: false, // expand <!-- @import "path" --> (default false)
|
|
129
|
-
validateExistence: true, //
|
|
129
|
+
validateExistence: true, // probe local images and doc links (data-asset-exists / data-doc-exists; default true)
|
|
130
130
|
signal: controller.signal, // cancels the conversion in the service too
|
|
131
131
|
timeoutMs: 10_000, // the conversion's deadline
|
|
132
132
|
enableSubscript: false, // Disable subscript (leaves ~2~ as plain text)
|
|
@@ -144,18 +144,26 @@ const parseResult = await parseMarkdown(
|
|
|
144
144
|
| `deniedPathSegments` | ✅ | Deny rules applied to every target the conversion resolves: `@import` targets, images and links. A pattern matches one whole path segment (`*` matches any run of characters within it), compared after NFKC normalization and case folding at every percent-decoding level (the semantics of `@aiquants/markdown-explorer`'s deny rules). Local targets must also stay inside `workspaceRoot`, also once symbolic links are resolved. A refused image renders without `src`, a refused link without a destination (with `validateExistence`, both are marked like a missing target, whether or not the target exists), and a refused import rejects the call. |
|
|
145
145
|
| `maxHtmlBytes` | ✅ | The largest HTML in bytes, a positive integer up to `MAX_HTML_BYTES_LIMIT`. The service stops while it renders and the call rejects with `MarkdownResourceExhaustedError`; the response the call accepts is bounded by twice this plus 64 KiB. |
|
|
146
146
|
| `resolveImports` | | Expand `<!-- @import "path" -->` directives (default `false`: a directive stays an HTML comment and nothing is read). Only Markdown (`.md`) targets the deny rules admit are read, nested imports included; a refused target rejects the call with `permission_denied`. |
|
|
147
|
-
| `validateExistence` | |
|
|
147
|
+
| `validateExistence` | | Probe local targets (default `true`): a local storage image also gets `data-asset-exists` (`"true"` or `"false"`) and a local doc link `data-doc-exists` (`"true"` or `"false"`). Cloud targets are never probed, and `data-asset-src` is written for every admitted storage image either way. |
|
|
148
148
|
| `signal` | | Cancels the call; the service stops converting. |
|
|
149
149
|
| `timeoutMs` | | The conversion's deadline in milliseconds (a positive integer); the service stops at it or at `MARKDOWN_CONVERT_TIMEOUT`, whichever comes first. |
|
|
150
150
|
| `enable*` | | Switch the syntax extensions and HTML plugins (each enabled unless `false`). The text plugins leave `summary` text (a `:::details` title included) as written. |
|
|
151
151
|
|
|
152
152
|
Invalid options throw `TypeError` / `RangeError` before any request. A conversion stopped at a size limit (the HTML limit, the service's source limit or a message limit) rejects with `MarkdownResourceExhaustedError` (its `cause` is the connect error); every other failure rejects with the `ConnectError` of the service (`invalid_argument`, `permission_denied`, `canceled`, `deadline_exceeded`, `internal`).
|
|
153
153
|
|
|
154
|
-
###
|
|
154
|
+
### Image and link targets
|
|
155
155
|
|
|
156
|
+
The converter writes document paths, never URLs, so a host decides how its files are served.
|
|
156
157
|
An image destination is a URL decoded once: `` names the file `a%41.png`, while `` names `aA.png` (a `%` not followed by two hexadecimal digits, as in `100%.png`, may be written as it is).
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
|
|
159
|
+
- **Storage images** (a local file inside `workspaceRoot`, or a `gcs://` / `gdrive://` object) have no `src`. Their document path is in `data-asset-src`, unescaped: the path from `workspaceRoot` for a local file (`資料/進捗100%.png`, `x.data`), the URI decoded once for a cloud object (`gcs://bucket/reports/fig 1.png`). The host writes the `src` from it, encoding the path for its own route; no URL is signed.
|
|
160
|
+
- **Existence**: with `validateExistence`, a local storage image also carries `data-asset-exists` (`"true"` or `"false"`); a cloud image is never probed.
|
|
161
|
+
- **Refused targets** (the deny rules, or outside `workspaceRoot`) have neither a `src` nor `data-asset-src`; with `validateExistence` they carry `data-asset-exists="false"` whether or not they exist.
|
|
162
|
+
- **Storage links** are `data-link-kind="doc"`: they keep the authored `href` (its fragment is what a host reads) and carry the document path in `data-doc-path`; a local one also gets `data-doc-exists` under `validateExistence`.
|
|
163
|
+
- `data-asset-src` and `data-asset-exists` come only from the converter: markers written in the document's raw HTML or by an HTML plugin are removed.
|
|
164
|
+
- Of an element's duplicate attributes only the first counts, as in a browser: the converter drops the rest, so the HTML carries no duplicate attribute and a repeated `src` or marker cannot make the converter and the browser read different values.
|
|
165
|
+
|
|
166
|
+
`MarkdownRenderer` shows an image without a `src` (or with `data-asset-exists="false"`) as a placeholder naming its `data-asset-src`, so HTML rendered before the host wrote the URLs shows which files are missing instead of blank space.
|
|
159
167
|
|
|
160
168
|
## Viewer, embeds and links
|
|
161
169
|
|
|
@@ -203,7 +211,7 @@ Every renderer of the package — `MarkdownRenderer` (and so `MarkdownViewer`) f
|
|
|
203
211
|
|
|
204
212
|
### Links
|
|
205
213
|
|
|
206
|
-
- A link is external when its `href` names a scheme in any case (`https:`, `HTTPS:`, `mailto:`) or another host (`//host/…`, `/\host/…`), whatever its `data-link-kind` says
|
|
214
|
+
- A link is external when its `href` names a scheme in any case (`https:`, `HTTPS:`, `mailto:`) or another host (`//host/…`, `/\host/…`), whatever its `data-link-kind` says, and when `data-link-kind` is `external`. An external link opens in a new tab with `rel="noreferrer"` and is never handed to `linkComponent`. The author's `target` and `rel` never survive.
|
|
207
215
|
- `linkComponent` receives `href`, `kind`, `docPath`, `docExists`, `className`, `children` and `attributes`: the link's `id`, `title`, `lang`, `dir`, `role`, `aria-*` and `data-footnote-*` (event handlers, `style` and `href`-like attributes never pass). Spread `attributes` onto the anchor you render so footnote references keep their `id` and `aria-describedby` and back-references keep their `aria-label`:
|
|
208
216
|
|
|
209
217
|
```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./chunk-MOJQB5TN-Cw864mUL.cjs"),u=require("./chunk-JWPE2WC7-5cM5nFf6.cjs"),n=require("./extractHeadings-lDHB2sBb.cjs"),i=require("./cynefin-VYW2F7L2-MpAliYy9.cjs");var p=i.createRailroadAbnfServices().RailroadAbnf.parser.LangiumParser,o=n.__name(e=>{const r=e.alternatives.map(c);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),c=n.__name(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),f=n.__name(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),d=n.__name(e=>{const r=b(e.primary);if(!e.repeat)return r;const{min:t,max:s}=f(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),b=n.__name(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return o(e.element);case"AbnfOptionalGroup":return{type:"optional",element:o(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),g=n.__name(e=>({name:e.name,definition:o(e.definition)}),"transformRule"),v=n.__name(e=>{u.populateCommonDb(e,a.db),e.title&&a.db.setTitle(e.title),e.rules.map(r=>a.db.addRule(g(r)))},"populateDb"),y={parse:n.__name(e=>{a.db.clear(),n.log.debug("[ABNF Parser] Starting Langium parse");const r=p.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new i.MermaidParseError(r);const t=r.value;n.log.debug("[ABNF Parser] Parsed rules:",t.rules.length),v(t),n.log.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a.db}},_={parser:y,db:a.db,renderer:a.renderer,styles:a.getStyles};exports.diagram=_;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-
|
|
2
|
-
import { p as f } from "./chunk-JWPE2WC7-
|
|
3
|
-
import { _ as n, $ as o } from "./extractHeadings-
|
|
1
|
+
import { g as p, r as u, d as a } from "./chunk-MOJQB5TN-D_h6bolU.js";
|
|
2
|
+
import { p as f } from "./chunk-JWPE2WC7-DpcSSOP5.js";
|
|
3
|
+
import { _ as n, $ as o } from "./extractHeadings-CGJexznE.js";
|
|
4
4
|
import { M as c, b as d } from "./cynefin-VYW2F7L2-Bkk-F_Js.js";
|
|
5
5
|
var v = d().RailroadAbnf.parser.LangiumParser, i = /* @__PURE__ */ n((e) => {
|
|
6
6
|
const r = e.alternatives.map(g);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aK as ln, aL as an, aM as y, aN as tn, aO as V, aP as O, aQ as _, aR as un, aS as rn, aT as Y, aU as o, aV as M, aW as sn, aX as on, aY as fn } from "./extractHeadings-
|
|
1
|
+
import { aK as ln, aL as an, aM as y, aN as tn, aO as V, aP as O, aQ as _, aR as un, aS as rn, aT as Y, aU as o, aV as M, aW as sn, aX as on, aY as fn } from "./extractHeadings-CGJexznE.js";
|
|
2
2
|
function cn(l) {
|
|
3
3
|
return l.innerRadius;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./extractHeadings-
|
|
1
|
+
"use strict";const n=require("./extractHeadings-lDHB2sBb.cjs");function $(o){return o.innerRadius}function b(o){return o.outerRadius}function k(o){return o.startAngle}function _(o){return o.endAngle}function nn(o){return o&&o.padAngle}function en(o,x,D,P,h,v,S,s){var E=D-o,r=P-x,e=S-h,p=s-v,i=p*E-e*r;if(!(i*i<n.epsilon))return i=(e*(x-v)-p*(o-h))/i,[o+i*E,x+i*r]}function M(o,x,D,P,h,v,S){var s=o-D,E=x-P,r=(S?v:-v)/n.sqrt(s*s+E*E),e=r*E,p=-r*s,i=o+e,u=x+p,c=D+e,f=P+p,j=(i+c)/2,l=(u+f)/2,y=c-i,g=f-u,A=y*y+g*g,R=h-v,T=i*f-c*u,H=(g<0?-1:1)*n.sqrt(n.max(0,R*R*A-T*T)),I=(T*g-y*H)/A,O=(-T*y-g*H)/A,q=(T*g+y*H)/A,d=(-T*y+g*H)/A,m=I-j,a=O-l,t=q-j,z=d-l;return m*m+a*a>t*t+z*z&&(I=q,O=d),{cx:I,cy:O,x01:-e,y01:-p,x11:I*(h/R-1),y11:O*(h/R-1)}}function an(){var o=$,x=b,D=n.constant(0),P=null,h=k,v=_,S=nn,s=null,E=n.withPath(r);function r(){var e,p,i=+o.apply(this,arguments),u=+x.apply(this,arguments),c=h.apply(this,arguments)-n.halfPi,f=v.apply(this,arguments)-n.halfPi,j=n.abs(f-c),l=f>c;if(s||(s=e=E()),u<i&&(p=u,u=i,i=p),!(u>n.epsilon))s.moveTo(0,0);else if(j>n.tau-n.epsilon)s.moveTo(u*n.cos(c),u*n.sin(c)),s.arc(0,0,u,c,f,!l),i>n.epsilon&&(s.moveTo(i*n.cos(f),i*n.sin(f)),s.arc(0,0,i,f,c,l));else{var y=c,g=f,A=c,R=f,T=j,H=j,I=S.apply(this,arguments)/2,O=I>n.epsilon&&(P?+P.apply(this,arguments):n.sqrt(i*i+u*u)),q=n.min(n.abs(u-i)/2,+D.apply(this,arguments)),d=q,m=q,a,t;if(O>n.epsilon){var z=n.asin(O/i*n.sin(I)),F=n.asin(O/u*n.sin(I));(T-=z*2)>n.epsilon?(z*=l?1:-1,A+=z,R-=z):(T=0,A=R=(c+f)/2),(H-=F*2)>n.epsilon?(F*=l?1:-1,y+=F,g-=F):(H=0,y=g=(c+f)/2)}var B=u*n.cos(y),C=u*n.sin(y),G=i*n.cos(R),J=i*n.sin(R);if(q>n.epsilon){var K=u*n.cos(g),L=u*n.sin(g),N=i*n.cos(A),Q=i*n.sin(A),w;if(j<n.pi)if(w=en(B,C,N,Q,K,L,G,J)){var U=B-w[0],V=C-w[1],W=K-w[0],X=L-w[1],Y=1/n.sin(n.acos((U*W+V*X)/(n.sqrt(U*U+V*V)*n.sqrt(W*W+X*X)))/2),Z=n.sqrt(w[0]*w[0]+w[1]*w[1]);d=n.min(q,(i-Z)/(Y-1)),m=n.min(q,(u-Z)/(Y+1))}else d=m=0}H>n.epsilon?m>n.epsilon?(a=M(N,Q,B,C,u,m,l),t=M(K,L,G,J,u,m,l),s.moveTo(a.cx+a.x01,a.cy+a.y01),m<q?s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,m,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,u,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),!l),s.arc(t.cx,t.cy,m,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):(s.moveTo(B,C),s.arc(0,0,u,y,g,!l)):s.moveTo(B,C),!(i>n.epsilon)||!(T>n.epsilon)?s.lineTo(G,J):d>n.epsilon?(a=M(G,J,K,L,i,-d,l),t=M(B,C,N,Q,i,-d,l),s.lineTo(a.cx+a.x01,a.cy+a.y01),d<q?s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(t.y01,t.x01),!l):(s.arc(a.cx,a.cy,d,n.atan2(a.y01,a.x01),n.atan2(a.y11,a.x11),!l),s.arc(0,0,i,n.atan2(a.cy+a.y11,a.cx+a.x11),n.atan2(t.cy+t.y11,t.cx+t.x11),l),s.arc(t.cx,t.cy,d,n.atan2(t.y11,t.x11),n.atan2(t.y01,t.x01),!l))):s.arc(0,0,i,R,A,l)}if(s.closePath(),e)return s=null,e+""||null}return r.centroid=function(){var e=(+o.apply(this,arguments)+ +x.apply(this,arguments))/2,p=(+h.apply(this,arguments)+ +v.apply(this,arguments))/2-n.pi/2;return[n.cos(p)*e,n.sin(p)*e]},r.innerRadius=function(e){return arguments.length?(o=typeof e=="function"?e:n.constant(+e),r):o},r.outerRadius=function(e){return arguments.length?(x=typeof e=="function"?e:n.constant(+e),r):x},r.cornerRadius=function(e){return arguments.length?(D=typeof e=="function"?e:n.constant(+e),r):D},r.padRadius=function(e){return arguments.length?(P=e==null?null:typeof e=="function"?e:n.constant(+e),r):P},r.startAngle=function(e){return arguments.length?(h=typeof e=="function"?e:n.constant(+e),r):h},r.endAngle=function(e){return arguments.length?(v=typeof e=="function"?e:n.constant(+e),r):v},r.padAngle=function(e){return arguments.length?(S=typeof e=="function"?e:n.constant(+e),r):S},r.context=function(e){return arguments.length?(s=e??null,r):s},r}exports.d3arc=an;
|