eeed-editor 0.1.13 → 0.1.14
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 +7 -3
- package/dist/{_basePickBy-SCyTYR1L.mjs → _basePickBy-CEkd0XdC.mjs} +2 -2
- package/dist/{_baseUniq-Bt7b1YX9.mjs → _baseUniq-BT9YRDH6.mjs} +1 -1
- package/dist/{arc-CExhmX1H.mjs → arc-CrfAF6jV.mjs} +1 -1
- package/dist/{architecture-U656AL7Q-DUrNTVG8.mjs → architecture-U656AL7Q-BXDyIjTd.mjs} +1 -1
- package/dist/{architectureDiagram-VXUJARFQ-CGX8pXdA.mjs → architectureDiagram-VXUJARFQ-C0wRUEtM.mjs} +4 -4
- package/dist/{blockDiagram-VD42YOAC-B8w8IErQ.mjs → blockDiagram-VD42YOAC-a8uU2YD1.mjs} +5 -5
- package/dist/{c4Diagram-YG6GDRKO-Blql-p5M.mjs → c4Diagram-YG6GDRKO-B4jru1i1.mjs} +2 -2
- package/dist/{channel-Dqs6Vluk.mjs → channel-Bf6TIAcE.mjs} +1 -1
- package/dist/{chunk-4BX2VUAB-DsRQrMrw.mjs → chunk-4BX2VUAB-CesipSEy.mjs} +1 -1
- package/dist/{chunk-55IACEB6-D6UuQ72n.mjs → chunk-55IACEB6-BfkXgkW7.mjs} +1 -1
- package/dist/{chunk-B4BG7PRW-CM-2QBXU.mjs → chunk-B4BG7PRW-rYl7scX0.mjs} +4 -4
- package/dist/{chunk-DI55MBZ5-DsF9srOg.mjs → chunk-DI55MBZ5-KjxZkID3.mjs} +3 -3
- package/dist/{chunk-FMBD7UC4-CMsIS1oh.mjs → chunk-FMBD7UC4-CdoeuytN.mjs} +1 -1
- package/dist/{chunk-QN33PNHL-DzzpfMZE.mjs → chunk-QN33PNHL-DFkMZx1g.mjs} +1 -1
- package/dist/{chunk-QZHKN3VN-D_zWydfb.mjs → chunk-QZHKN3VN-BkCoRwfe.mjs} +1 -1
- package/dist/{chunk-TZMSLE5B-DPmcD9DN.mjs → chunk-TZMSLE5B-aCc6iQoB.mjs} +1 -1
- package/dist/{classDiagram-v2-WZHVMYZB-CKPZgrCF.mjs → classDiagram-2ON5EDUG-DovnAJJ-.mjs} +2 -2
- package/dist/{classDiagram-2ON5EDUG-CKPZgrCF.mjs → classDiagram-v2-WZHVMYZB-DovnAJJ-.mjs} +2 -2
- package/dist/{clone-Z0sFntzL.mjs → clone-Bgn0kKfR.mjs} +1 -1
- package/dist/{cose-bilkent-S5V4N54A-7uhIm5gf.mjs → cose-bilkent-S5V4N54A-BK8vsbSg.mjs} +2 -2
- package/dist/{dagre-6UL2VRFP-BdIJjAvB.mjs → dagre-6UL2VRFP-DTKvQpBz.mjs} +6 -6
- package/dist/{diagram-PSM6KHXK-hweX_cEV.mjs → diagram-PSM6KHXK-DbeZS0lZ.mjs} +4 -4
- package/dist/{diagram-QEK2KX5R-CLQza6nv.mjs → diagram-QEK2KX5R-B2wgkbJv.mjs} +3 -3
- package/dist/{diagram-S2PKOQOG-1vYIPEoY.mjs → diagram-S2PKOQOG-9N97BhIm.mjs} +3 -3
- package/dist/eeed-editor.es.js +2 -2
- package/dist/eeed-editor.umd.js +306 -306
- package/dist/{erDiagram-Q2GNP2WA-CxVbMPkF.mjs → erDiagram-Q2GNP2WA-Be2naADX.mjs} +4 -4
- package/dist/{flowDiagram-NV44I4VS-N4-kh4F2.mjs → flowDiagram-NV44I4VS-BCekSJyr.mjs} +5 -5
- package/dist/{ganttDiagram-LVOFAZNH-DqNWZaxR.mjs → ganttDiagram-LVOFAZNH-DLE0G_aQ.mjs} +3 -3
- package/dist/{gitGraph-F6HP7TQM-CAkUKBa5.mjs → gitGraph-F6HP7TQM-D_INUXWz.mjs} +1 -1
- package/dist/{gitGraphDiagram-NY62KEGX-BcRbUxrP.mjs → gitGraphDiagram-NY62KEGX-CFP-tbN2.mjs} +4 -4
- package/dist/{graph-gt3d_bvL.mjs → graph-DVnQzTDU.mjs} +2 -2
- package/dist/{index-0MGZ8NOT.mjs → index-Bg_uVi12.mjs} +4447 -4267
- package/dist/index.css +1 -1
- package/dist/info-NVLQJR56-Bg8bOk4W.mjs +5 -0
- package/dist/{infoDiagram-ER5ION4S-BKWu24lw.mjs → infoDiagram-ER5ION4S-s2Yp71ql.mjs} +2 -2
- package/dist/{journeyDiagram-XKPGCS4Q-Dj_7hxeE.mjs → journeyDiagram-XKPGCS4Q-CBa5wdie.mjs} +4 -4
- package/dist/{kanban-definition-3W4ZIXB7-C3OSMI-Z.mjs → kanban-definition-3W4ZIXB7-OcVTugCl.mjs} +2 -2
- package/dist/{layout-BJieZLAa.mjs → layout-mkZS9nxv.mjs} +4 -4
- package/dist/{linear-CqvKT1G0.mjs → linear-H2f9LXEG.mjs} +1 -1
- package/dist/{mermaid-parser.core-BWZKsaHU.mjs → mermaid-parser.core-BOUdyKiu.mjs} +11 -11
- package/dist/{mermaid.core-C-SMPMZY.mjs → mermaid.core-Detd19yK.mjs} +30 -30
- package/dist/{mindmap-definition-VGOIOE7T-BjYoTQqj.mjs → mindmap-definition-VGOIOE7T-C0Jrl77c.mjs} +3 -3
- package/dist/{packet-BFZMPI3H-octt7dZv.mjs → packet-BFZMPI3H-XcF80dGc.mjs} +1 -1
- package/dist/pie-7BOR55EZ-BB0Yx1zG.mjs +5 -0
- package/dist/{pieDiagram-ADFJNKIX-DSXe5akp.mjs → pieDiagram-ADFJNKIX-BKJCTnqK.mjs} +4 -4
- package/dist/{quadrantDiagram-AYHSOK5B-CLZ9vukg.mjs → quadrantDiagram-AYHSOK5B-CNpXyKC_.mjs} +2 -2
- package/dist/{radar-NHE76QYJ-CLF5yWHR.mjs → radar-NHE76QYJ-LVAmdxN5.mjs} +1 -1
- package/dist/{requirementDiagram-UZGBJVZJ-Dj7NgzdB.mjs → requirementDiagram-UZGBJVZJ-DKlo_g1y.mjs} +3 -3
- package/dist/{sankeyDiagram-TZEHDZUN-XR7TBcsI.mjs → sankeyDiagram-TZEHDZUN-BlcFWxGM.mjs} +1 -1
- package/dist/{sequenceDiagram-WL72ISMW-DEsK5Gfz.mjs → sequenceDiagram-WL72ISMW-Br1vA5Su.mjs} +3 -3
- package/dist/src/index.vue.d.ts +1 -1
- package/dist/{stateDiagram-FKZM4ZOC-CmMjNFHR.mjs → stateDiagram-FKZM4ZOC-Dn8r5dJ1.mjs} +4 -4
- package/dist/{stateDiagram-v2-4FDKWEC3-BX8s4Yln.mjs → stateDiagram-v2-4FDKWEC3-Dn7F_OIh.mjs} +2 -2
- package/dist/{timeline-definition-IT6M3QCI-CJdQSMPS.mjs → timeline-definition-IT6M3QCI-lEx0wVcX.mjs} +2 -2
- package/dist/{treemap-KMMF4GRG-CEXkd4Nw.mjs → treemap-KMMF4GRG-Jr6yIZsF.mjs} +1 -1
- package/dist/{xychartDiagram-PRI3JC2R-Cx25QKzI.mjs → xychartDiagram-PRI3JC2R-DNJMbKy-.mjs} +2 -2
- package/package.json +1 -1
- package/dist/htmlToMarkdown-DdRci5k7.mjs +0 -184
- package/dist/info-NVLQJR56-DWIxPn7F.mjs +0 -5
- package/dist/pie-7BOR55EZ-VToVdBeY.mjs +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a4 as S, a7 as F, aG as j, _ as p, g as q, s as H, a as Z, b as J, q as K, p as Q, l as z, c as X, D as Y, H as ee, N as te, e as ae, y as re, F as ne } from "./mermaid.core-
|
|
2
|
-
import { p as ie } from "./chunk-4BX2VUAB-
|
|
3
|
-
import { p as se } from "./mermaid-parser.core-
|
|
4
|
-
import { d as I } from "./arc-
|
|
1
|
+
import { a4 as S, a7 as F, aG as j, _ as p, g as q, s as H, a as Z, b as J, q as K, p as Q, l as z, c as X, D as Y, H as ee, N as te, e as ae, y as re, F as ne } from "./mermaid.core-Detd19yK.mjs";
|
|
2
|
+
import { p as ie } from "./chunk-4BX2VUAB-CesipSEy.mjs";
|
|
3
|
+
import { p as se } from "./mermaid-parser.core-BOUdyKiu.mjs";
|
|
4
|
+
import { d as I } from "./arc-CrfAF6jV.mjs";
|
|
5
5
|
import { o as le } from "./ordinal-C0oynhte.mjs";
|
|
6
6
|
function oe(e, a) {
|
|
7
7
|
return a < e ? -1 : a > e ? 1 : a >= e ? 0 : NaN;
|
package/dist/{quadrantDiagram-AYHSOK5B-CLZ9vukg.mjs → quadrantDiagram-AYHSOK5B-CNpXyKC_.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as o, s as _e, g as Ae, q as ie, p as ke, a as Fe, b as Pe, c as wt, l as At, d as zt, e as ve, y as Ce, F as D, K as Le, i as Ee } from "./mermaid.core-
|
|
2
|
-
import { l as ee } from "./linear-
|
|
1
|
+
import { _ as o, s as _e, g as Ae, q as ie, p as ke, a as Fe, b as Pe, c as wt, l as At, d as zt, e as ve, y as Ce, F as D, K as Le, i as Ee } from "./mermaid.core-Detd19yK.mjs";
|
|
2
|
+
import { l as ee } from "./linear-H2f9LXEG.mjs";
|
|
3
3
|
var Vt = function() {
|
|
4
4
|
var t = /* @__PURE__ */ o(function(j, r, l, g) {
|
|
5
5
|
for (l = l || {}, g = j.length; g--; l[j[g]] = r) ;
|
package/dist/{requirementDiagram-UZGBJVZJ-Dj7NgzdB.mjs → requirementDiagram-UZGBJVZJ-DKlo_g1y.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as Ge } from "./chunk-55IACEB6-
|
|
2
|
-
import { s as ze } from "./chunk-QN33PNHL-
|
|
3
|
-
import { _ as f, b as Xe, a as Je, s as Ze, g as et, p as tt, q as st, c as Ne, l as qe, y as it, B as rt, o as nt, r as at, u as lt } from "./mermaid.core-
|
|
1
|
+
import { g as Ge } from "./chunk-55IACEB6-BfkXgkW7.mjs";
|
|
2
|
+
import { s as ze } from "./chunk-QN33PNHL-DFkMZx1g.mjs";
|
|
3
|
+
import { _ as f, b as Xe, a as Je, s as Ze, g as et, p as tt, q as st, c as Ne, l as qe, y as it, B as rt, o as nt, r as at, u as lt } from "./mermaid.core-Detd19yK.mjs";
|
|
4
4
|
var Ae = function() {
|
|
5
5
|
var e = /* @__PURE__ */ f(function(P, i, r, l) {
|
|
6
6
|
for (r = r || {}, l = P.length; l--; r[P[l]] = i) ;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as p, p as _t, q as xt, s as vt, g as bt, b as wt, a as St, c as lt, z as Lt, d as H, V as Et, y as At, k as Tt } from "./mermaid.core-
|
|
1
|
+
import { _ as p, p as _t, q as xt, s as vt, g as bt, b as wt, a as St, c as lt, z as Lt, d as H, V as Et, y as At, k as Tt } from "./mermaid.core-Detd19yK.mjs";
|
|
2
2
|
import { o as Mt } from "./ordinal-C0oynhte.mjs";
|
|
3
3
|
function Nt(t) {
|
|
4
4
|
for (var e = t.length / 6 | 0, i = new Array(e), a = 0; a < e; ) i[a] = "#" + t.slice(a * 6, ++a * 6);
|
package/dist/{sequenceDiagram-WL72ISMW-DEsK5Gfz.mjs → sequenceDiagram-WL72ISMW-Br1vA5Su.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as we, b as Xt, g as ct, d as ve, c as Jt, e as Qt } from "./chunk-TZMSLE5B-
|
|
2
|
-
import { _ as f, n as Ie, c as st, d as St, l as Q, j as re, e as Le, f as _e, k as I, b as se, s as Ae, p as ke, a as Pe, g as Ne, q as Se, t as Me, J as Re, y as De, i as Mt, u as F, L as z, M as _t, N as ie, Z as Ce, O as Oe, P as ne, E as Ht } from "./mermaid.core-
|
|
3
|
-
import { I as Be } from "./chunk-QZHKN3VN-
|
|
1
|
+
import { a as we, b as Xt, g as ct, d as ve, c as Jt, e as Qt } from "./chunk-TZMSLE5B-aCc6iQoB.mjs";
|
|
2
|
+
import { _ as f, n as Ie, c as st, d as St, l as Q, j as re, e as Le, f as _e, k as I, b as se, s as Ae, p as ke, a as Pe, g as Ne, q as Se, t as Me, J as Re, y as De, i as Mt, u as F, L as z, M as _t, N as ie, Z as Ce, O as Oe, P as ne, E as Ht } from "./mermaid.core-Detd19yK.mjs";
|
|
3
|
+
import { I as Be } from "./chunk-QZHKN3VN-BkCoRwfe.mjs";
|
|
4
4
|
var Ut = function() {
|
|
5
5
|
var e = /* @__PURE__ */ f(function(pt, v, A, L) {
|
|
6
6
|
for (A = A || {}, L = pt.length; L--; A[pt[L]] = v) ;
|
package/dist/src/index.vue.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ type __VLS_Props = {
|
|
|
35
35
|
};
|
|
36
36
|
onUploadFile?: (file: File) => Promise<string> | string;
|
|
37
37
|
onSave?: (title: string, html: string) => Promise<boolean> | boolean;
|
|
38
|
-
onChange?: (html: string, text: string) => void;
|
|
38
|
+
onChange?: (html: string, text: string, markdown: string) => void;
|
|
39
39
|
};
|
|
40
40
|
type ToolBarItem = "history" | "formatBrush" | "clearFormatting" | "fontFamily" | "heading" | "fontSize" | "fontColor" | "highlightColor" | "bold" | "italic" | "underline" | "strike" | "blockquote" | "horizontalRule" | "inlineCode" | "table" | "list" | "textAlign" | "indent" | "lineHeight" | "insert";
|
|
41
41
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as G, a as W, S as N } from "./chunk-DI55MBZ5-
|
|
2
|
-
import { _ as f, c as t, d as H, l as S, e as P, k as z, R as _, S as U, O as C, u as F } from "./mermaid.core-
|
|
3
|
-
import { G as O } from "./graph-
|
|
4
|
-
import { l as J } from "./layout-
|
|
1
|
+
import { s as G, a as W, S as N } from "./chunk-DI55MBZ5-KjxZkID3.mjs";
|
|
2
|
+
import { _ as f, c as t, d as H, l as S, e as P, k as z, R as _, S as U, O as C, u as F } from "./mermaid.core-Detd19yK.mjs";
|
|
3
|
+
import { G as O } from "./graph-DVnQzTDU.mjs";
|
|
4
|
+
import { l as J } from "./layout-mkZS9nxv.mjs";
|
|
5
5
|
var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit).attr("cy", t().state.padding + t().state.sizeUnit), "drawStartState"), D = /* @__PURE__ */ f((e) => e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", t().state.textHeight).attr("class", "divider").attr("x2", t().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"), Y = /* @__PURE__ */ f((e, i) => {
|
|
6
6
|
const d = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 2 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), c = d.node().getBBox();
|
|
7
7
|
return e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", c.width + 2 * t().state.padding).attr("height", c.height + 2 * t().state.padding).attr("rx", t().state.radius), d;
|
package/dist/{stateDiagram-v2-4FDKWEC3-BX8s4Yln.mjs → stateDiagram-v2-4FDKWEC3-Dn7F_OIh.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as a, b as t, a as r, S as s } from "./chunk-DI55MBZ5-
|
|
2
|
-
import { _ as i } from "./mermaid.core-
|
|
1
|
+
import { s as a, b as t, a as r, S as s } from "./chunk-DI55MBZ5-KjxZkID3.mjs";
|
|
2
|
+
import { _ as i } from "./mermaid.core-Detd19yK.mjs";
|
|
3
3
|
var _ = {
|
|
4
4
|
parser: r,
|
|
5
5
|
get db() {
|
package/dist/{timeline-definition-IT6M3QCI-CJdQSMPS.mjs → timeline-definition-IT6M3QCI-lEx0wVcX.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as s, c as xt, l as E, d as q, V as kt, W as vt, X as _t, Y as bt, B as wt, $ as St, y as Et } from "./mermaid.core-
|
|
2
|
-
import { d as nt } from "./arc-
|
|
1
|
+
import { _ as s, c as xt, l as E, d as q, V as kt, W as vt, X as _t, Y as bt, B as wt, $ as St, y as Et } from "./mermaid.core-Detd19yK.mjs";
|
|
2
|
+
import { d as nt } from "./arc-CrfAF6jV.mjs";
|
|
3
3
|
var X = function() {
|
|
4
4
|
var n = /* @__PURE__ */ s(function(f, r, a, h) {
|
|
5
5
|
for (a = a || {}, h = f.length; h--; a[f[h]] = r) ;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as a, s as gi, g as xi, q as Xt, p as di, a as fi, b as pi, l as Nt, H as mi, e as yi, y as bi, E as St, D as Yt, F as Ai, K as wi, i as Ci, aF as Si, R as Wt } from "./mermaid.core-
|
|
1
|
+
import { _ as a, s as gi, g as xi, q as Xt, p as di, a as fi, b as pi, l as Nt, H as mi, e as yi, y as bi, E as St, D as Yt, F as Ai, K as wi, i as Ci, aF as Si, R as Wt } from "./mermaid.core-Detd19yK.mjs";
|
|
2
2
|
import { i as _i } from "./init-DjUOC4st.mjs";
|
|
3
3
|
import { o as ki } from "./ordinal-C0oynhte.mjs";
|
|
4
|
-
import { l as zt } from "./linear-
|
|
4
|
+
import { l as zt } from "./linear-H2f9LXEG.mjs";
|
|
5
5
|
function Ri(e, t, i) {
|
|
6
6
|
e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i;
|
|
7
7
|
for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, o = new Array(n); ++s < n; )
|
package/package.json
CHANGED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
const h = /* @__PURE__ */ new Set([
|
|
2
|
-
"address",
|
|
3
|
-
"article",
|
|
4
|
-
"aside",
|
|
5
|
-
"blockquote",
|
|
6
|
-
"div",
|
|
7
|
-
"dl",
|
|
8
|
-
"fieldset",
|
|
9
|
-
"figcaption",
|
|
10
|
-
"figure",
|
|
11
|
-
"footer",
|
|
12
|
-
"form",
|
|
13
|
-
"h1",
|
|
14
|
-
"h2",
|
|
15
|
-
"h3",
|
|
16
|
-
"h4",
|
|
17
|
-
"h5",
|
|
18
|
-
"h6",
|
|
19
|
-
"header",
|
|
20
|
-
"hr",
|
|
21
|
-
"li",
|
|
22
|
-
"main",
|
|
23
|
-
"nav",
|
|
24
|
-
"ol",
|
|
25
|
-
"p",
|
|
26
|
-
"pre",
|
|
27
|
-
"section",
|
|
28
|
-
"table",
|
|
29
|
-
"ul"
|
|
30
|
-
]), b = (r) => r.replace(/\\/g, "\\\\").replace(/\*/g, "\\*").replace(/_/g, "\\_").replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/^([#>+-])/gm, "\\$1").replace(/^(\d+)\. /gm, "$1\\. "), p = (r) => r.replace(/^\n+|\n+$/g, ""), A = (r) => r.replace(/\u00a0/g, " ").replace(/[ \t]+\n/g, `
|
|
31
|
-
`).replace(/\n{3,}/g, `
|
|
32
|
-
|
|
33
|
-
`).trim(), m = (r, e) => Array.from(r.childNodes).map((t) => w(t, e)).join(""), c = (r, e) => m(r, { ...e, inline: !0 }).trim(), $ = (r, e) => p(m(r, { ...e, inline: !1 })), y = (r) => {
|
|
34
|
-
var o;
|
|
35
|
-
const e = r.getAttribute("data-language");
|
|
36
|
-
if (e) return e;
|
|
37
|
-
const t = r.matches("code") ? r : r.querySelector("code");
|
|
38
|
-
return ((o = ((t == null ? void 0 : t.getAttribute("class")) || r.getAttribute("class") || "").match(/(?:^|\s)language-([^\s]+)/)) == null ? void 0 : o[1]) || "";
|
|
39
|
-
}, k = (r) => {
|
|
40
|
-
const e = r.matches("code") ? r : r.querySelector("code");
|
|
41
|
-
return ((e == null ? void 0 : e.textContent) || r.textContent || "").replace(/\n$/, "");
|
|
42
|
-
}, T = (r) => {
|
|
43
|
-
const e = y(r), t = k(r);
|
|
44
|
-
return `\`\`\`${e}
|
|
45
|
-
${t}
|
|
46
|
-
\`\`\``;
|
|
47
|
-
}, L = (r) => {
|
|
48
|
-
const e = r.getAttribute("formula") || r.getAttribute("data-formula") || "";
|
|
49
|
-
return r.getAttribute("display") === "true" || r.getAttribute("data-display") === "true" ? `
|
|
50
|
-
$$
|
|
51
|
-
${e}
|
|
52
|
-
$$
|
|
53
|
-
` : `$${e}$`;
|
|
54
|
-
}, N = (r) => `\`\`\`mermaid
|
|
55
|
-
${(r.getAttribute("code") || r.textContent || "").trim()}
|
|
56
|
-
\`\`\``, C = (r, e) => {
|
|
57
|
-
const t = Array.from(r.querySelectorAll("tr")).map(
|
|
58
|
-
(i) => Array.from(i.children).filter((l) => ["TD", "TH"].includes(l.tagName)).map((l) => c(l, e).replace(/\|/g, "\\|").replace(/\s+/g, " ").trim())
|
|
59
|
-
).filter((i) => i.length > 0);
|
|
60
|
-
if (!t.length) return "";
|
|
61
|
-
const n = Math.max(...t.map((i) => i.length)), o = (i) => Array.from({ length: n }, (l, g) => i[g] || ""), a = o(t[0]), s = Array.from({ length: n }, () => "---"), d = t.slice(1).map(o);
|
|
62
|
-
return [a, s, ...d].map((i) => `| ${i.join(" | ")} |`).join(`
|
|
63
|
-
`);
|
|
64
|
-
}, u = (r, e, t, n) => {
|
|
65
|
-
const o = Math.max(1, n || Number(r.getAttribute("data-level")) || e.listDepth + 1), a = " ".repeat(Math.max(0, o - 1)), s = r.querySelector(":scope > .content") || r, i = $(s, { ...e, listDepth: o }).split(`
|
|
66
|
-
`), l = i.shift() || "", g = i.map((f) => f ? `${a} ${f}` : "").join(`
|
|
67
|
-
`);
|
|
68
|
-
return `${a}${t} ${l}${g ? `
|
|
69
|
-
${g}` : ""}`;
|
|
70
|
-
}, w = (r, e) => {
|
|
71
|
-
if (r.nodeType === Node.TEXT_NODE)
|
|
72
|
-
return b(r.nodeValue || "");
|
|
73
|
-
if (r.nodeType !== Node.ELEMENT_NODE) return "";
|
|
74
|
-
const t = r, n = t.tagName.toLowerCase();
|
|
75
|
-
if (["script", "style", "button", "select", "option"].includes(n)) return "";
|
|
76
|
-
if (t.matches('div[data-type="mermaid"]'))
|
|
77
|
-
return `
|
|
78
|
-
|
|
79
|
-
${N(t)}
|
|
80
|
-
|
|
81
|
-
`;
|
|
82
|
-
if (n === "katex-formula")
|
|
83
|
-
return L(t);
|
|
84
|
-
if (n === "pre" || t.classList.contains("code-block-container"))
|
|
85
|
-
return `
|
|
86
|
-
|
|
87
|
-
${T(t)}
|
|
88
|
-
|
|
89
|
-
`;
|
|
90
|
-
if (n === "br") return `
|
|
91
|
-
`;
|
|
92
|
-
if (n === "hr") return `
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
`;
|
|
97
|
-
if (n === "img") {
|
|
98
|
-
const a = t.getAttribute("src") || "", s = t.getAttribute("alt") || "";
|
|
99
|
-
return a ? `` : "";
|
|
100
|
-
}
|
|
101
|
-
if (n === "a") {
|
|
102
|
-
const a = t.getAttribute("href") || "", s = c(t, e) || a;
|
|
103
|
-
return a ? `[${s}](${a})` : s;
|
|
104
|
-
}
|
|
105
|
-
if (n === "code") {
|
|
106
|
-
const a = t.textContent || "", s = a.includes("`") ? "``" : "`";
|
|
107
|
-
return `${s}${a}${s}`;
|
|
108
|
-
}
|
|
109
|
-
if (["strong", "b"].includes(n)) return `**${c(t, e)}**`;
|
|
110
|
-
if (["em", "i"].includes(n)) return `*${c(t, e)}*`;
|
|
111
|
-
if (["s", "strike", "del"].includes(n)) return `~~${c(t, e)}~~`;
|
|
112
|
-
if (n === "u") return `<u>${c(t, e)}</u>`;
|
|
113
|
-
if (/^h[1-6]$/.test(n)) {
|
|
114
|
-
const a = Number(n.slice(1));
|
|
115
|
-
return `
|
|
116
|
-
|
|
117
|
-
${"#".repeat(a)} ${c(t, e)}
|
|
118
|
-
|
|
119
|
-
`;
|
|
120
|
-
}
|
|
121
|
-
if (n === "p")
|
|
122
|
-
return `
|
|
123
|
-
|
|
124
|
-
${c(t, e)}
|
|
125
|
-
|
|
126
|
-
`;
|
|
127
|
-
if (n === "blockquote")
|
|
128
|
-
return `
|
|
129
|
-
|
|
130
|
-
${$(t, e).split(`
|
|
131
|
-
`).map((s) => `> ${s}`).join(`
|
|
132
|
-
`)}
|
|
133
|
-
|
|
134
|
-
`;
|
|
135
|
-
if (n === "ul")
|
|
136
|
-
return `
|
|
137
|
-
|
|
138
|
-
${Array.from(t.children).filter((s) => s.tagName.toLowerCase() === "li").map((s) => u(s, e, "-", e.listDepth + 1)).join(`
|
|
139
|
-
`)}
|
|
140
|
-
|
|
141
|
-
`;
|
|
142
|
-
if (n === "ol")
|
|
143
|
-
return `
|
|
144
|
-
|
|
145
|
-
${Array.from(t.children).filter((s) => s.tagName.toLowerCase() === "li").map((s, d) => u(s, e, `${d + 1}.`, e.listDepth + 1)).join(`
|
|
146
|
-
`)}
|
|
147
|
-
|
|
148
|
-
`;
|
|
149
|
-
if (n === "li") return u(t, e, "-", e.listDepth + 1);
|
|
150
|
-
if (t.classList.contains("bullet-item"))
|
|
151
|
-
return `
|
|
152
|
-
${u(t, e, "-")}
|
|
153
|
-
`;
|
|
154
|
-
if (t.classList.contains("ordered-item")) {
|
|
155
|
-
const a = t.getAttribute("data-order") || "1";
|
|
156
|
-
return `
|
|
157
|
-
${u(t, e, `${a}.`)}
|
|
158
|
-
`;
|
|
159
|
-
}
|
|
160
|
-
if (t.classList.contains("task-item")) {
|
|
161
|
-
const a = t.getAttribute("data-checked") === "true" || t.classList.contains("checked");
|
|
162
|
-
return `
|
|
163
|
-
${u(t, e, a ? "- [x]" : "- [ ]")}
|
|
164
|
-
`;
|
|
165
|
-
}
|
|
166
|
-
if (n === "table")
|
|
167
|
-
return `
|
|
168
|
-
|
|
169
|
-
${C(t, e)}
|
|
170
|
-
|
|
171
|
-
`;
|
|
172
|
-
const o = m(t, e);
|
|
173
|
-
return h.has(n) && !e.inline ? `
|
|
174
|
-
|
|
175
|
-
${p(o)}
|
|
176
|
-
|
|
177
|
-
` : o;
|
|
178
|
-
}, M = (r) => {
|
|
179
|
-
const e = document.createElement("div");
|
|
180
|
-
return e.innerHTML = r, A(m(e, { inline: !1, listDepth: 0 }));
|
|
181
|
-
};
|
|
182
|
-
export {
|
|
183
|
-
M as htmlToMarkdown
|
|
184
|
-
};
|