@powerduck/md-editor 0.10.2 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +145 -145
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Compartment as Be, EditorState as Ft } from "@codemirror/state";
|
|
2
|
-
import { EditorView as
|
|
2
|
+
import { EditorView as me, keymap as $e, lineNumbers as Ue } from "@codemirror/view";
|
|
3
3
|
import { history as zt, defaultKeymap as Kt, historyKeymap as Gt } from "@codemirror/commands";
|
|
4
4
|
import { markdown as qt } from "@codemirror/lang-markdown";
|
|
5
5
|
import { languages as Wt } from "@codemirror/language-data";
|
|
@@ -186,12 +186,12 @@ async function Qt(n) {
|
|
|
186
186
|
return Jt(t, n);
|
|
187
187
|
}
|
|
188
188
|
function Jt(n, e) {
|
|
189
|
-
var c, l, d, h, p,
|
|
189
|
+
var c, l, d, h, p, g, b;
|
|
190
190
|
const t = {}, i = new DOMParser().parseFromString(n, "text/html"), a = ((c = i.querySelector('meta[property="og:title"]')) == null ? void 0 : c.getAttribute("content")) ?? ((l = i.querySelector("title")) == null ? void 0 : l.textContent) ?? void 0;
|
|
191
191
|
a && (t.title = a.trim());
|
|
192
192
|
const s = ((d = i.querySelector('meta[property="og:description"]')) == null ? void 0 : d.getAttribute("content")) ?? ((h = i.querySelector('meta[name="description"]')) == null ? void 0 : h.getAttribute("content"));
|
|
193
193
|
s && (t.description = s.trim());
|
|
194
|
-
const o = ((p = i.querySelector('meta[property="og:image"]')) == null ? void 0 : p.getAttribute("content")) ?? ((
|
|
194
|
+
const o = ((p = i.querySelector('meta[property="og:image"]')) == null ? void 0 : p.getAttribute("content")) ?? ((g = i.querySelector('meta[property="og:image:secure_url"]')) == null ? void 0 : g.getAttribute("content")) ?? ((b = i.querySelector('meta[name="twitter:image"]')) == null ? void 0 : b.getAttribute("content"));
|
|
195
195
|
return o && (t.thumbnail = o.startsWith("http") ? o : new URL(o, e).href), t;
|
|
196
196
|
}
|
|
197
197
|
class jt {
|
|
@@ -411,7 +411,7 @@ function nn(n) {
|
|
|
411
411
|
const d = e.src.slice(e.bMarks[t + 1], e.bMarks[c]).split(`
|
|
412
412
|
`).map((E) => E.trim()).filter((E) => E.length > 0);
|
|
413
413
|
let h = "", p = "";
|
|
414
|
-
const
|
|
414
|
+
const g = [];
|
|
415
415
|
for (const E of d)
|
|
416
416
|
if (E.startsWith("# "))
|
|
417
417
|
h = E.slice(2).trim();
|
|
@@ -419,9 +419,9 @@ function nn(n) {
|
|
|
419
419
|
const N = E.match(/^!\[thumbnail\]\((.+)\)$/);
|
|
420
420
|
N && (p = N[1] ?? "");
|
|
421
421
|
} else
|
|
422
|
-
|
|
422
|
+
g.push(E);
|
|
423
423
|
const b = e.push("doclink_block", "div", 0);
|
|
424
|
-
return b.content = JSON.stringify({ url: o, title: h, thumbnail: p, description:
|
|
424
|
+
return b.content = JSON.stringify({ url: o, title: h, thumbnail: p, description: g.join(" ") }), e.line = c + 1, !0;
|
|
425
425
|
}), n.renderer.rules.doclink_block = (e, t) => {
|
|
426
426
|
const i = e[t];
|
|
427
427
|
if (!i) return "";
|
|
@@ -456,14 +456,14 @@ class rn {
|
|
|
456
456
|
$e.of([...Kt, ...Gt]),
|
|
457
457
|
this.customKeymapCompartment.of([]),
|
|
458
458
|
qt({ codeLanguages: Wt }),
|
|
459
|
-
|
|
459
|
+
me.lineWrapping,
|
|
460
460
|
this.lineNumbersCompartment.of(t.lineNumbers ? Ue() : []),
|
|
461
|
-
|
|
461
|
+
me.updateListener.of((s) => {
|
|
462
462
|
var o, c, l;
|
|
463
463
|
s.docChanged && ((o = t.onChange) == null || o.call(t, s.state.doc.toString())), (s.docChanged || s.selectionSet) && ((c = this.mention) == null || c.update(), (l = this.docLink) == null || l.update());
|
|
464
464
|
}),
|
|
465
465
|
// Close dropdowns when the editor loses focus
|
|
466
|
-
|
|
466
|
+
me.domEventHandlers({
|
|
467
467
|
paste: (s) => this.handlePaste(s),
|
|
468
468
|
drop: (s) => this.handleDrop(s),
|
|
469
469
|
blur: () => {
|
|
@@ -478,7 +478,7 @@ class rn {
|
|
|
478
478
|
}
|
|
479
479
|
})
|
|
480
480
|
];
|
|
481
|
-
this.view = new
|
|
481
|
+
this.view = new me({
|
|
482
482
|
state: Ft.create({ doc: t.value ?? "", extensions: i }),
|
|
483
483
|
parent: e
|
|
484
484
|
}), (r = t.mention) != null && r.onMentionSearch && (this.mention = new Zt(this.view, t.mention)), (a = t.docLink) != null && a.onDocSearch && (this.docLink = new jt(this.view, t.docLink));
|
|
@@ -709,13 +709,13 @@ function cn(n) {
|
|
|
709
709
|
}
|
|
710
710
|
h++;
|
|
711
711
|
}
|
|
712
|
-
const
|
|
712
|
+
const g = h < r ? h : r - 1, b = t.push("mindmap_block", "div", 0);
|
|
713
713
|
return b.content = t.getLines(
|
|
714
714
|
i + 1,
|
|
715
|
-
|
|
715
|
+
g,
|
|
716
716
|
t.blkIndent,
|
|
717
717
|
!0
|
|
718
|
-
), b.map = [i,
|
|
718
|
+
), b.map = [i, g + 1], b.markup = l[1], b.info = "mindmap", t.line = g + 1, !0;
|
|
719
719
|
}
|
|
720
720
|
), n.renderer.rules.mindmap_block = (t, i) => {
|
|
721
721
|
const r = t[i];
|
|
@@ -820,7 +820,7 @@ function J(n, ...e) {
|
|
|
820
820
|
}), /** @type {T} */
|
|
821
821
|
t;
|
|
822
822
|
}
|
|
823
|
-
const pn = "</span>", qe = (n) => !!n.scope,
|
|
823
|
+
const pn = "</span>", qe = (n) => !!n.scope, mn = (n, { prefix: e }) => {
|
|
824
824
|
if (n.startsWith("language:"))
|
|
825
825
|
return n.replace("language:", "language-");
|
|
826
826
|
if (n.includes(".")) {
|
|
@@ -832,7 +832,7 @@ const pn = "</span>", qe = (n) => !!n.scope, gn = (n, { prefix: e }) => {
|
|
|
832
832
|
}
|
|
833
833
|
return `${e}${n}`;
|
|
834
834
|
};
|
|
835
|
-
class
|
|
835
|
+
class gn {
|
|
836
836
|
/**
|
|
837
837
|
* Creates a new HTMLRenderer
|
|
838
838
|
*
|
|
@@ -855,7 +855,7 @@ class mn {
|
|
|
855
855
|
* @param {Node} node */
|
|
856
856
|
openNode(e) {
|
|
857
857
|
if (!qe(e)) return;
|
|
858
|
-
const t =
|
|
858
|
+
const t = mn(
|
|
859
859
|
e.scope,
|
|
860
860
|
{ prefix: this.classPrefix }
|
|
861
861
|
);
|
|
@@ -968,7 +968,7 @@ class fn extends Ae {
|
|
|
968
968
|
t && (i.scope = `language:${t}`), this.add(i);
|
|
969
969
|
}
|
|
970
970
|
toHTML() {
|
|
971
|
-
return new
|
|
971
|
+
return new gn(this, this.options).value();
|
|
972
972
|
}
|
|
973
973
|
finalize() {
|
|
974
974
|
return this.closeAllNodes(), !0;
|
|
@@ -1186,7 +1186,7 @@ const vn = /\b\B/, at = "[a-zA-Z]\\w*", Ce = "[a-zA-Z_]\\w*", ct = "\\b\\d+(\\.\
|
|
|
1186
1186
|
}
|
|
1187
1187
|
);
|
|
1188
1188
|
};
|
|
1189
|
-
var
|
|
1189
|
+
var ge = /* @__PURE__ */ Object.freeze({
|
|
1190
1190
|
__proto__: null,
|
|
1191
1191
|
APOS_STRING_MODE: Tn,
|
|
1192
1192
|
BACKSLASH_ESCAPE: ue,
|
|
@@ -1443,7 +1443,7 @@ class ii extends Error {
|
|
|
1443
1443
|
super(e), this.name = "HTMLInjectionError", this.html = t;
|
|
1444
1444
|
}
|
|
1445
1445
|
}
|
|
1446
|
-
const Se = rt, Ve = J, Xe = Symbol("nomatch"), ri = 7,
|
|
1446
|
+
const Se = rt, Ve = J, Xe = Symbol("nomatch"), ri = 7, mt = function(n) {
|
|
1447
1447
|
const e = /* @__PURE__ */ Object.create(null), t = /* @__PURE__ */ Object.create(null), i = [];
|
|
1448
1448
|
let r = !0;
|
|
1449
1449
|
const a = "Could not find the language '{}', did you forget to load/include a language module?", s = { disableAutodetect: !0, name: "Plain text", contains: [] };
|
|
@@ -1486,19 +1486,19 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, v = _), f ===
|
|
|
1486
1486
|
}
|
|
1487
1487
|
function h(u, _, f, v) {
|
|
1488
1488
|
const T = /* @__PURE__ */ Object.create(null);
|
|
1489
|
-
function P(
|
|
1490
|
-
return
|
|
1489
|
+
function P(m, y) {
|
|
1490
|
+
return m.keywords[y];
|
|
1491
1491
|
}
|
|
1492
1492
|
function z() {
|
|
1493
1493
|
if (!w.keywords) {
|
|
1494
1494
|
F.addText(M);
|
|
1495
1495
|
return;
|
|
1496
1496
|
}
|
|
1497
|
-
let
|
|
1497
|
+
let m = 0;
|
|
1498
1498
|
w.keywordPatternRe.lastIndex = 0;
|
|
1499
1499
|
let y = w.keywordPatternRe.exec(M), k = "";
|
|
1500
1500
|
for (; y; ) {
|
|
1501
|
-
k += M.substring(
|
|
1501
|
+
k += M.substring(m, y.index);
|
|
1502
1502
|
const x = Y.case_insensitive ? y[0].toLowerCase() : y[0], K = P(w, x);
|
|
1503
1503
|
if (K) {
|
|
1504
1504
|
const [Z, Ut] = K;
|
|
@@ -1510,92 +1510,92 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, v = _), f ===
|
|
|
1510
1510
|
}
|
|
1511
1511
|
} else
|
|
1512
1512
|
k += y[0];
|
|
1513
|
-
|
|
1513
|
+
m = w.keywordPatternRe.lastIndex, y = w.keywordPatternRe.exec(M);
|
|
1514
1514
|
}
|
|
1515
|
-
k += M.substring(
|
|
1515
|
+
k += M.substring(m), F.addText(k);
|
|
1516
1516
|
}
|
|
1517
1517
|
function q() {
|
|
1518
1518
|
if (M === "") return;
|
|
1519
|
-
let
|
|
1519
|
+
let m = null;
|
|
1520
1520
|
if (typeof w.subLanguage == "string") {
|
|
1521
1521
|
if (!e[w.subLanguage]) {
|
|
1522
1522
|
F.addText(M);
|
|
1523
1523
|
return;
|
|
1524
1524
|
}
|
|
1525
|
-
|
|
1526
|
-
|
|
1525
|
+
m = h(w.subLanguage, M, !0, Pe[w.subLanguage]), Pe[w.subLanguage] = /** @type {CompiledMode} */
|
|
1526
|
+
m._top;
|
|
1527
1527
|
} else
|
|
1528
|
-
|
|
1529
|
-
w.relevance > 0 && (pe +=
|
|
1528
|
+
m = g(M, w.subLanguage.length ? w.subLanguage : null);
|
|
1529
|
+
w.relevance > 0 && (pe += m.relevance), F.__addSublanguage(m._emitter, m.language);
|
|
1530
1530
|
}
|
|
1531
1531
|
function G() {
|
|
1532
1532
|
w.subLanguage != null ? q() : z(), M = "";
|
|
1533
1533
|
}
|
|
1534
|
-
function W(
|
|
1535
|
-
|
|
1534
|
+
function W(m, y) {
|
|
1535
|
+
m !== "" && (F.startScope(y), F.addText(m), F.endScope());
|
|
1536
1536
|
}
|
|
1537
|
-
function Oe(
|
|
1537
|
+
function Oe(m, y) {
|
|
1538
1538
|
let k = 1;
|
|
1539
1539
|
const x = y.length - 1;
|
|
1540
1540
|
for (; k <= x; ) {
|
|
1541
|
-
if (!
|
|
1541
|
+
if (!m._emit[k]) {
|
|
1542
1542
|
k++;
|
|
1543
1543
|
continue;
|
|
1544
1544
|
}
|
|
1545
|
-
const K = Y.classNameAliases[
|
|
1545
|
+
const K = Y.classNameAliases[m[k]] || m[k], Z = y[k];
|
|
1546
1546
|
K ? W(Z, K) : (M = Z, z(), M = ""), k++;
|
|
1547
1547
|
}
|
|
1548
1548
|
}
|
|
1549
|
-
function Ie(
|
|
1550
|
-
return
|
|
1549
|
+
function Ie(m, y) {
|
|
1550
|
+
return m.scope && typeof m.scope == "string" && F.openNode(Y.classNameAliases[m.scope] || m.scope), m.beginScope && (m.beginScope._wrap ? (W(M, Y.classNameAliases[m.beginScope._wrap] || m.beginScope._wrap), M = "") : m.beginScope._multi && (Oe(m.beginScope, y), M = "")), w = Object.create(m, { parent: { value: w } }), w;
|
|
1551
1551
|
}
|
|
1552
|
-
function Le(
|
|
1553
|
-
let x = yn(
|
|
1552
|
+
function Le(m, y, k) {
|
|
1553
|
+
let x = yn(m.endRe, k);
|
|
1554
1554
|
if (x) {
|
|
1555
|
-
if (
|
|
1556
|
-
const K = new Ge(
|
|
1557
|
-
|
|
1555
|
+
if (m["on:end"]) {
|
|
1556
|
+
const K = new Ge(m);
|
|
1557
|
+
m["on:end"](y, K), K.isMatchIgnored && (x = !1);
|
|
1558
1558
|
}
|
|
1559
1559
|
if (x) {
|
|
1560
|
-
for (;
|
|
1561
|
-
|
|
1562
|
-
return
|
|
1560
|
+
for (; m.endsParent && m.parent; )
|
|
1561
|
+
m = m.parent;
|
|
1562
|
+
return m;
|
|
1563
1563
|
}
|
|
1564
1564
|
}
|
|
1565
|
-
if (
|
|
1566
|
-
return Le(
|
|
1565
|
+
if (m.endsWithParent)
|
|
1566
|
+
return Le(m.parent, y, k);
|
|
1567
1567
|
}
|
|
1568
|
-
function Lt(
|
|
1569
|
-
return w.matcher.regexIndex === 0 ? (M +=
|
|
1568
|
+
function Lt(m) {
|
|
1569
|
+
return w.matcher.regexIndex === 0 ? (M += m[0], 1) : (Ne = !0, 0);
|
|
1570
1570
|
}
|
|
1571
|
-
function Dt(
|
|
1572
|
-
const y =
|
|
1571
|
+
function Dt(m) {
|
|
1572
|
+
const y = m[0], k = m.rule, x = new Ge(k), K = [k.__beforeBegin, k["on:begin"]];
|
|
1573
1573
|
for (const Z of K)
|
|
1574
|
-
if (Z && (Z(
|
|
1574
|
+
if (Z && (Z(m, x), x.isMatchIgnored))
|
|
1575
1575
|
return Lt(y);
|
|
1576
|
-
return k.skip ? M += y : (k.excludeBegin && (M += y), G(), !k.returnBegin && !k.excludeBegin && (M = y)), Ie(k,
|
|
1576
|
+
return k.skip ? M += y : (k.excludeBegin && (M += y), G(), !k.returnBegin && !k.excludeBegin && (M = y)), Ie(k, m), k.returnBegin ? 0 : y.length;
|
|
1577
1577
|
}
|
|
1578
|
-
function Pt(
|
|
1579
|
-
const y =
|
|
1578
|
+
function Pt(m) {
|
|
1579
|
+
const y = m[0], k = _.substring(m.index), x = Le(w, m, k);
|
|
1580
1580
|
if (!x)
|
|
1581
1581
|
return Xe;
|
|
1582
1582
|
const K = w;
|
|
1583
|
-
w.endScope && w.endScope._wrap ? (G(), W(y, w.endScope._wrap)) : w.endScope && w.endScope._multi ? (G(), Oe(w.endScope,
|
|
1583
|
+
w.endScope && w.endScope._wrap ? (G(), W(y, w.endScope._wrap)) : w.endScope && w.endScope._multi ? (G(), Oe(w.endScope, m)) : K.skip ? M += y : (K.returnEnd || K.excludeEnd || (M += y), G(), K.excludeEnd && (M = y));
|
|
1584
1584
|
do
|
|
1585
1585
|
w.scope && F.closeNode(), !w.skip && !w.subLanguage && (pe += w.relevance), w = w.parent;
|
|
1586
1586
|
while (w !== x.parent);
|
|
1587
|
-
return x.starts && Ie(x.starts,
|
|
1587
|
+
return x.starts && Ie(x.starts, m), K.returnEnd ? 0 : y.length;
|
|
1588
1588
|
}
|
|
1589
1589
|
function Bt() {
|
|
1590
|
-
const
|
|
1590
|
+
const m = [];
|
|
1591
1591
|
for (let y = w; y !== Y; y = y.parent)
|
|
1592
|
-
y.scope &&
|
|
1593
|
-
|
|
1592
|
+
y.scope && m.unshift(y.scope);
|
|
1593
|
+
m.forEach((y) => F.openNode(y));
|
|
1594
1594
|
}
|
|
1595
1595
|
let he = {};
|
|
1596
|
-
function De(
|
|
1596
|
+
function De(m, y) {
|
|
1597
1597
|
const k = y && y[0];
|
|
1598
|
-
if (M +=
|
|
1598
|
+
if (M += m, k == null)
|
|
1599
1599
|
return G(), 0;
|
|
1600
1600
|
if (he.type === "begin" && y.type === "end" && he.index === y.index && k === "") {
|
|
1601
1601
|
if (M += _.slice(y.index, y.index + 1), !r) {
|
|
@@ -1635,10 +1635,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, v = _), f ===
|
|
|
1635
1635
|
else {
|
|
1636
1636
|
for (w.matcher.considerAll(); ; ) {
|
|
1637
1637
|
ke++, Ne ? Ne = !1 : w.matcher.considerAll(), w.matcher.lastIndex = ee;
|
|
1638
|
-
const
|
|
1639
|
-
if (!
|
|
1640
|
-
const y = _.substring(ee,
|
|
1641
|
-
ee =
|
|
1638
|
+
const m = w.matcher.exec(_);
|
|
1639
|
+
if (!m) break;
|
|
1640
|
+
const y = _.substring(ee, m.index), k = De(y, m);
|
|
1641
|
+
ee = m.index + k;
|
|
1642
1642
|
}
|
|
1643
1643
|
De(_.substring(ee));
|
|
1644
1644
|
}
|
|
@@ -1650,18 +1650,18 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, v = _), f ===
|
|
|
1650
1650
|
_emitter: F,
|
|
1651
1651
|
_top: w
|
|
1652
1652
|
};
|
|
1653
|
-
} catch (
|
|
1654
|
-
if (
|
|
1653
|
+
} catch (m) {
|
|
1654
|
+
if (m.message && m.message.includes("Illegal"))
|
|
1655
1655
|
return {
|
|
1656
1656
|
language: u,
|
|
1657
1657
|
value: Se(_),
|
|
1658
1658
|
illegal: !0,
|
|
1659
1659
|
relevance: 0,
|
|
1660
1660
|
_illegalBy: {
|
|
1661
|
-
message:
|
|
1661
|
+
message: m.message,
|
|
1662
1662
|
index: ee,
|
|
1663
1663
|
context: _.slice(ee - 100, ee + 100),
|
|
1664
|
-
mode:
|
|
1664
|
+
mode: m.mode,
|
|
1665
1665
|
resultSoFar: ve
|
|
1666
1666
|
},
|
|
1667
1667
|
_emitter: F
|
|
@@ -1672,11 +1672,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, v = _), f ===
|
|
|
1672
1672
|
value: Se(_),
|
|
1673
1673
|
illegal: !1,
|
|
1674
1674
|
relevance: 0,
|
|
1675
|
-
errorRaised:
|
|
1675
|
+
errorRaised: m,
|
|
1676
1676
|
_emitter: F,
|
|
1677
1677
|
_top: w
|
|
1678
1678
|
};
|
|
1679
|
-
throw
|
|
1679
|
+
throw m;
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
function p(u) {
|
|
@@ -1689,7 +1689,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, v = _), f ===
|
|
|
1689
1689
|
};
|
|
1690
1690
|
return _._emitter.addText(u), _;
|
|
1691
1691
|
}
|
|
1692
|
-
function
|
|
1692
|
+
function g(u, _) {
|
|
1693
1693
|
_ = _ || o.languages || Object.keys(e);
|
|
1694
1694
|
const f = p(u), v = _.filter($).filter(V).map(
|
|
1695
1695
|
(G) => h(G, u, !1)
|
|
@@ -1728,7 +1728,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, v = _), f ===
|
|
|
1728
1728
|
u.innerHTML
|
|
1729
1729
|
);
|
|
1730
1730
|
_ = u;
|
|
1731
|
-
const v = _.textContent, T = f ? d(v, { language: f, ignoreIllegals: !0 }) :
|
|
1731
|
+
const v = _.textContent, T = f ? d(v, { language: f, ignoreIllegals: !0 }) : g(v);
|
|
1732
1732
|
u.innerHTML = T.value, u.dataset.highlighted = "yes", b(u, f, T.language), u.result = {
|
|
1733
1733
|
language: T.language,
|
|
1734
1734
|
// TODO: remove with version 11.0
|
|
@@ -1821,7 +1821,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, v = _), f ===
|
|
|
1821
1821
|
}
|
|
1822
1822
|
Object.assign(n, {
|
|
1823
1823
|
highlight: d,
|
|
1824
|
-
highlightAuto:
|
|
1824
|
+
highlightAuto: g,
|
|
1825
1825
|
highlightAll: C,
|
|
1826
1826
|
highlightElement: E,
|
|
1827
1827
|
// TODO: Remove with v12 API
|
|
@@ -1849,11 +1849,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`), T = u, v = _), f ===
|
|
|
1849
1849
|
optional: _n,
|
|
1850
1850
|
anyNumberOfTimes: bn
|
|
1851
1851
|
};
|
|
1852
|
-
for (const u in
|
|
1853
|
-
typeof
|
|
1854
|
-
return Object.assign(n,
|
|
1855
|
-
}, se =
|
|
1856
|
-
se.newInstance = () =>
|
|
1852
|
+
for (const u in ge)
|
|
1853
|
+
typeof ge[u] == "object" && it(ge[u]);
|
|
1854
|
+
return Object.assign(n, ge), n;
|
|
1855
|
+
}, se = mt({});
|
|
1856
|
+
se.newInstance = () => mt({});
|
|
1857
1857
|
var si = se;
|
|
1858
1858
|
se.HighlightJS = se;
|
|
1859
1859
|
se.default = se;
|
|
@@ -1909,7 +1909,7 @@ const A = /* @__PURE__ */ hn(si), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", oi = [
|
|
|
1909
1909
|
"undefined",
|
|
1910
1910
|
"NaN",
|
|
1911
1911
|
"Infinity"
|
|
1912
|
-
],
|
|
1912
|
+
], gt = [
|
|
1913
1913
|
// Fundamental objects
|
|
1914
1914
|
"Object",
|
|
1915
1915
|
"Function",
|
|
@@ -2001,7 +2001,7 @@ const A = /* @__PURE__ */ hn(si), Qe = "[A-Za-z$_][0-9A-Za-z$_]*", oi = [
|
|
|
2001
2001
|
// Node.js
|
|
2002
2002
|
], li = [].concat(
|
|
2003
2003
|
bt,
|
|
2004
|
-
|
|
2004
|
+
gt,
|
|
2005
2005
|
ft
|
|
2006
2006
|
);
|
|
2007
2007
|
function _t(n) {
|
|
@@ -2073,7 +2073,7 @@ function _t(n) {
|
|
|
2073
2073
|
keywords: o,
|
|
2074
2074
|
contains: []
|
|
2075
2075
|
// defined later
|
|
2076
|
-
},
|
|
2076
|
+
}, g = {
|
|
2077
2077
|
begin: ".?html`",
|
|
2078
2078
|
end: "",
|
|
2079
2079
|
starts: {
|
|
@@ -2165,7 +2165,7 @@ function _t(n) {
|
|
|
2165
2165
|
}, U = [
|
|
2166
2166
|
n.APOS_STRING_MODE,
|
|
2167
2167
|
n.QUOTE_STRING_MODE,
|
|
2168
|
-
|
|
2168
|
+
g,
|
|
2169
2169
|
b,
|
|
2170
2170
|
E,
|
|
2171
2171
|
N,
|
|
@@ -2257,7 +2257,7 @@ function _t(n) {
|
|
|
2257
2257
|
keywords: {
|
|
2258
2258
|
_: [
|
|
2259
2259
|
// se we still get relevance credit for JS library classes
|
|
2260
|
-
...
|
|
2260
|
+
...gt,
|
|
2261
2261
|
...ft
|
|
2262
2262
|
]
|
|
2263
2263
|
}
|
|
@@ -2376,7 +2376,7 @@ function _t(n) {
|
|
|
2376
2376
|
H,
|
|
2377
2377
|
n.APOS_STRING_MODE,
|
|
2378
2378
|
n.QUOTE_STRING_MODE,
|
|
2379
|
-
|
|
2379
|
+
g,
|
|
2380
2380
|
b,
|
|
2381
2381
|
E,
|
|
2382
2382
|
N,
|
|
@@ -2730,7 +2730,7 @@ function di(n) {
|
|
|
2730
2730
|
keywords: o,
|
|
2731
2731
|
contains: []
|
|
2732
2732
|
// defined later
|
|
2733
|
-
},
|
|
2733
|
+
}, g = {
|
|
2734
2734
|
begin: ".?html`",
|
|
2735
2735
|
end: "",
|
|
2736
2736
|
starts: {
|
|
@@ -2822,7 +2822,7 @@ function di(n) {
|
|
|
2822
2822
|
}, U = [
|
|
2823
2823
|
n.APOS_STRING_MODE,
|
|
2824
2824
|
n.QUOTE_STRING_MODE,
|
|
2825
|
-
|
|
2825
|
+
g,
|
|
2826
2826
|
b,
|
|
2827
2827
|
E,
|
|
2828
2828
|
N,
|
|
@@ -3033,7 +3033,7 @@ function di(n) {
|
|
|
3033
3033
|
H,
|
|
3034
3034
|
n.APOS_STRING_MODE,
|
|
3035
3035
|
n.QUOTE_STRING_MODE,
|
|
3036
|
-
|
|
3036
|
+
g,
|
|
3037
3037
|
b,
|
|
3038
3038
|
E,
|
|
3039
3039
|
N,
|
|
@@ -3236,7 +3236,7 @@ function St(n) {
|
|
|
3236
3236
|
E.contains.splice(O, 1, S);
|
|
3237
3237
|
};
|
|
3238
3238
|
Object.assign(t.keywords, l), t.exports.PARAMS_CONTAINS.push(d);
|
|
3239
|
-
const p = t.contains.find((E) => E.scope === "attr"),
|
|
3239
|
+
const p = t.contains.find((E) => E.scope === "attr"), g = Object.assign(
|
|
3240
3240
|
{},
|
|
3241
3241
|
p,
|
|
3242
3242
|
{ match: e.concat(i, e.lookahead(/\s*\?:/)) }
|
|
@@ -3246,13 +3246,13 @@ function St(n) {
|
|
|
3246
3246
|
// class reference for highlighting the params types
|
|
3247
3247
|
p,
|
|
3248
3248
|
// highlight the params key
|
|
3249
|
-
|
|
3249
|
+
g
|
|
3250
3250
|
// Added for optional property assignment highlighting
|
|
3251
3251
|
]), t.contains = t.contains.concat([
|
|
3252
3252
|
d,
|
|
3253
3253
|
a,
|
|
3254
3254
|
s,
|
|
3255
|
-
|
|
3255
|
+
g
|
|
3256
3256
|
// Added for optional property assignment highlighting
|
|
3257
3257
|
]), h(t, "shebang", n.SHEBANG()), h(t, "use_strict", o);
|
|
3258
3258
|
const b = t.contains.find((E) => E.label === "func.def");
|
|
@@ -3497,7 +3497,7 @@ function At(n) {
|
|
|
3497
3497
|
n.APOS_STRING_MODE,
|
|
3498
3498
|
n.QUOTE_STRING_MODE
|
|
3499
3499
|
]
|
|
3500
|
-
}, p = "[0-9](_?[0-9])*",
|
|
3500
|
+
}, p = "[0-9](_?[0-9])*", g = `(\\b(${p}))?\\.(${p})|\\b(${p})\\.`, b = `\\b|${i.join("|")}`, E = {
|
|
3501
3501
|
className: "number",
|
|
3502
3502
|
relevance: 0,
|
|
3503
3503
|
variants: [
|
|
@@ -3512,10 +3512,10 @@ function At(n) {
|
|
|
3512
3512
|
// because both MUST contain a decimal point and so cannot be confused with
|
|
3513
3513
|
// the interior part of an identifier
|
|
3514
3514
|
{
|
|
3515
|
-
begin: `(\\b(${p})|(${
|
|
3515
|
+
begin: `(\\b(${p})|(${g}))[eE][+-]?(${p})[jJ]?(?=${b})`
|
|
3516
3516
|
},
|
|
3517
3517
|
{
|
|
3518
|
-
begin: `(${
|
|
3518
|
+
begin: `(${g})[jJ]?`
|
|
3519
3519
|
},
|
|
3520
3520
|
// decinteger, bininteger, octinteger, hexinteger
|
|
3521
3521
|
// https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals
|
|
@@ -3798,7 +3798,7 @@ function Me(n) {
|
|
|
3798
3798
|
"tcsh",
|
|
3799
3799
|
"dash",
|
|
3800
3800
|
"scsh"
|
|
3801
|
-
],
|
|
3801
|
+
], g = n.SHEBANG({
|
|
3802
3802
|
binary: `(${p.join("|")})`,
|
|
3803
3803
|
relevance: 10
|
|
3804
3804
|
}), b = {
|
|
@@ -4065,7 +4065,7 @@ function Me(n) {
|
|
|
4065
4065
|
]
|
|
4066
4066
|
},
|
|
4067
4067
|
contains: [
|
|
4068
|
-
|
|
4068
|
+
g,
|
|
4069
4069
|
// to catch known shells and boost relevancy
|
|
4070
4070
|
n.SHEBANG(),
|
|
4071
4071
|
// to catch unknown shells but still highlight the shebang
|
|
@@ -4082,7 +4082,7 @@ function Me(n) {
|
|
|
4082
4082
|
]
|
|
4083
4083
|
};
|
|
4084
4084
|
}
|
|
4085
|
-
const
|
|
4085
|
+
const mi = (n) => ({
|
|
4086
4086
|
IMPORTANT: {
|
|
4087
4087
|
scope: "meta",
|
|
4088
4088
|
begin: "!important"
|
|
@@ -4119,7 +4119,7 @@ const gi = (n) => ({
|
|
|
4119
4119
|
className: "attr",
|
|
4120
4120
|
begin: /--[A-Za-z_][A-Za-z0-9_-]*/
|
|
4121
4121
|
}
|
|
4122
|
-
}),
|
|
4122
|
+
}), gi = [
|
|
4123
4123
|
"a",
|
|
4124
4124
|
"abbr",
|
|
4125
4125
|
"address",
|
|
@@ -4240,7 +4240,7 @@ const gi = (n) => ({
|
|
|
4240
4240
|
"foreignObject",
|
|
4241
4241
|
"clipPath"
|
|
4242
4242
|
], bi = [
|
|
4243
|
-
...
|
|
4243
|
+
...gi,
|
|
4244
4244
|
...fi
|
|
4245
4245
|
], _i = [
|
|
4246
4246
|
"any-hover",
|
|
@@ -4890,7 +4890,7 @@ const gi = (n) => ({
|
|
|
4890
4890
|
"zoom"
|
|
4891
4891
|
].sort().reverse();
|
|
4892
4892
|
function vi(n) {
|
|
4893
|
-
const e = n.regex, t =
|
|
4893
|
+
const e = n.regex, t = mi(n), i = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }, r = "and or not only", a = /@-?\w[\w]*(-\w+)*/, s = "[a-zA-Z-][a-zA-Z0-9_-]*", o = [
|
|
4894
4894
|
n.APOS_STRING_MODE,
|
|
4895
4895
|
n.QUOTE_STRING_MODE
|
|
4896
4896
|
];
|
|
@@ -5771,7 +5771,7 @@ function ki(n) {
|
|
|
5771
5771
|
"nulls last",
|
|
5772
5772
|
"depth first",
|
|
5773
5773
|
"breadth first"
|
|
5774
|
-
],
|
|
5774
|
+
], g = d, b = [
|
|
5775
5775
|
...l,
|
|
5776
5776
|
...c
|
|
5777
5777
|
].filter((I) => !d.includes(I)), E = {
|
|
@@ -5782,9 +5782,9 @@ function ki(n) {
|
|
|
5782
5782
|
match: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
|
|
5783
5783
|
relevance: 0
|
|
5784
5784
|
}, S = {
|
|
5785
|
-
match: e.concat(/\b/, e.either(...
|
|
5785
|
+
match: e.concat(/\b/, e.either(...g), /\s*\(/),
|
|
5786
5786
|
relevance: 0,
|
|
5787
|
-
keywords: { built_in:
|
|
5787
|
+
keywords: { built_in: g }
|
|
5788
5788
|
};
|
|
5789
5789
|
function O(I) {
|
|
5790
5790
|
return e.concat(
|
|
@@ -5908,7 +5908,7 @@ function xt(n) {
|
|
|
5908
5908
|
] }), p = {
|
|
5909
5909
|
className: "number",
|
|
5910
5910
|
begin: "\\b" + "[0-9]{4}(-[0-9][0-9]){0,2}" + "([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?" + "(\\.[0-9]*)?" + "([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?" + "\\b"
|
|
5911
|
-
},
|
|
5911
|
+
}, g = {
|
|
5912
5912
|
end: ",",
|
|
5913
5913
|
endsWithParent: !0,
|
|
5914
5914
|
excludeEnd: !0,
|
|
@@ -5917,13 +5917,13 @@ function xt(n) {
|
|
|
5917
5917
|
}, b = {
|
|
5918
5918
|
begin: /\{/,
|
|
5919
5919
|
end: /\}/,
|
|
5920
|
-
contains: [
|
|
5920
|
+
contains: [g],
|
|
5921
5921
|
illegal: "\\n",
|
|
5922
5922
|
relevance: 0
|
|
5923
5923
|
}, E = {
|
|
5924
5924
|
begin: "\\[",
|
|
5925
5925
|
end: "\\]",
|
|
5926
|
-
contains: [
|
|
5926
|
+
contains: [g],
|
|
5927
5927
|
illegal: "\\n",
|
|
5928
5928
|
relevance: 0
|
|
5929
5929
|
}, N = [
|
|
@@ -6007,7 +6007,7 @@ function xt(n) {
|
|
|
6007
6007
|
a,
|
|
6008
6008
|
s
|
|
6009
6009
|
], S = [...N];
|
|
6010
|
-
return S.pop(), S.push(o),
|
|
6010
|
+
return S.pop(), S.push(o), g.contains = S, {
|
|
6011
6011
|
name: "YAML",
|
|
6012
6012
|
case_insensitive: !0,
|
|
6013
6013
|
aliases: ["yml"],
|
|
@@ -6162,7 +6162,7 @@ function Ct(n) {
|
|
|
6162
6162
|
]
|
|
6163
6163
|
}, h = n.inherit(l, { contains: [] }), p = n.inherit(d, { contains: [] });
|
|
6164
6164
|
l.contains.push(p), d.contains.push(h);
|
|
6165
|
-
let
|
|
6165
|
+
let g = [
|
|
6166
6166
|
t,
|
|
6167
6167
|
c
|
|
6168
6168
|
];
|
|
@@ -6172,8 +6172,8 @@ function Ct(n) {
|
|
|
6172
6172
|
h,
|
|
6173
6173
|
p
|
|
6174
6174
|
].forEach((S) => {
|
|
6175
|
-
S.contains = S.contains.concat(
|
|
6176
|
-
}),
|
|
6175
|
+
S.contains = S.contains.concat(g);
|
|
6176
|
+
}), g = g.concat(l, d), {
|
|
6177
6177
|
name: "Markdown",
|
|
6178
6178
|
aliases: [
|
|
6179
6179
|
"md",
|
|
@@ -6187,7 +6187,7 @@ function Ct(n) {
|
|
|
6187
6187
|
{
|
|
6188
6188
|
begin: "^#{1,6}",
|
|
6189
6189
|
end: "$",
|
|
6190
|
-
contains:
|
|
6190
|
+
contains: g
|
|
6191
6191
|
},
|
|
6192
6192
|
{
|
|
6193
6193
|
begin: "(?=^.+?\\n[=-]{2,}$)",
|
|
@@ -6196,7 +6196,7 @@ function Ct(n) {
|
|
|
6196
6196
|
{
|
|
6197
6197
|
begin: "^",
|
|
6198
6198
|
end: "\\n",
|
|
6199
|
-
contains:
|
|
6199
|
+
contains: g
|
|
6200
6200
|
}
|
|
6201
6201
|
]
|
|
6202
6202
|
}
|
|
@@ -6212,7 +6212,7 @@ function Ct(n) {
|
|
|
6212
6212
|
{
|
|
6213
6213
|
className: "quote",
|
|
6214
6214
|
begin: "^>\\s+",
|
|
6215
|
-
contains:
|
|
6215
|
+
contains: g,
|
|
6216
6216
|
end: "$"
|
|
6217
6217
|
},
|
|
6218
6218
|
r,
|
|
@@ -6792,7 +6792,7 @@ function Ti(n) {
|
|
|
6792
6792
|
"super",
|
|
6793
6793
|
"this"
|
|
6794
6794
|
]
|
|
6795
|
-
},
|
|
6795
|
+
}, g = {
|
|
6796
6796
|
className: "meta",
|
|
6797
6797
|
begin: "@" + t,
|
|
6798
6798
|
contains: [
|
|
@@ -6925,7 +6925,7 @@ function Ti(n) {
|
|
|
6925
6925
|
keywords: p,
|
|
6926
6926
|
relevance: 0,
|
|
6927
6927
|
contains: [
|
|
6928
|
-
|
|
6928
|
+
g,
|
|
6929
6929
|
n.APOS_STRING_MODE,
|
|
6930
6930
|
n.QUOTE_STRING_MODE,
|
|
6931
6931
|
Je,
|
|
@@ -6937,7 +6937,7 @@ function Ti(n) {
|
|
|
6937
6937
|
]
|
|
6938
6938
|
},
|
|
6939
6939
|
Je,
|
|
6940
|
-
|
|
6940
|
+
g
|
|
6941
6941
|
]
|
|
6942
6942
|
};
|
|
6943
6943
|
}
|
|
@@ -7036,7 +7036,7 @@ function Si(n) {
|
|
|
7036
7036
|
t,
|
|
7037
7037
|
n.C_BLOCK_COMMENT_MODE
|
|
7038
7038
|
]
|
|
7039
|
-
},
|
|
7039
|
+
}, g = {
|
|
7040
7040
|
className: "meta",
|
|
7041
7041
|
begin: /#\s*[a-z]+\b/,
|
|
7042
7042
|
end: /$/,
|
|
@@ -7052,7 +7052,7 @@ function Si(n) {
|
|
|
7052
7052
|
]
|
|
7053
7053
|
}, b = [
|
|
7054
7054
|
p,
|
|
7055
|
-
|
|
7055
|
+
g
|
|
7056
7056
|
], E = {
|
|
7057
7057
|
className: "title",
|
|
7058
7058
|
begin: e.optional(r) + n.IDENT_RE,
|
|
@@ -7268,7 +7268,7 @@ function Si(n) {
|
|
|
7268
7268
|
]
|
|
7269
7269
|
),
|
|
7270
7270
|
exports: {
|
|
7271
|
-
preprocessor:
|
|
7271
|
+
preprocessor: g,
|
|
7272
7272
|
strings: d,
|
|
7273
7273
|
keywords: C
|
|
7274
7274
|
}
|
|
@@ -7348,7 +7348,7 @@ function Ot(n) {
|
|
|
7348
7348
|
t,
|
|
7349
7349
|
n.C_BLOCK_COMMENT_MODE
|
|
7350
7350
|
]
|
|
7351
|
-
},
|
|
7351
|
+
}, g = [
|
|
7352
7352
|
h,
|
|
7353
7353
|
p
|
|
7354
7354
|
], b = {
|
|
@@ -7646,7 +7646,7 @@ function Ot(n) {
|
|
|
7646
7646
|
)
|
|
7647
7647
|
}, H = [
|
|
7648
7648
|
$,
|
|
7649
|
-
...
|
|
7649
|
+
...g,
|
|
7650
7650
|
o,
|
|
7651
7651
|
t,
|
|
7652
7652
|
n.C_BLOCK_COMMENT_MODE,
|
|
@@ -7755,7 +7755,7 @@ function Ot(n) {
|
|
|
7755
7755
|
o,
|
|
7756
7756
|
t,
|
|
7757
7757
|
n.C_BLOCK_COMMENT_MODE,
|
|
7758
|
-
...
|
|
7758
|
+
...g
|
|
7759
7759
|
]
|
|
7760
7760
|
};
|
|
7761
7761
|
return {
|
|
@@ -7778,7 +7778,7 @@ function Ot(n) {
|
|
|
7778
7778
|
$,
|
|
7779
7779
|
H,
|
|
7780
7780
|
[
|
|
7781
|
-
...
|
|
7781
|
+
...g,
|
|
7782
7782
|
{
|
|
7783
7783
|
// containers: ie, `vector <int> rooms (9);`
|
|
7784
7784
|
begin: "\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",
|
|
@@ -7849,31 +7849,31 @@ function xi(n, e = {}) {
|
|
|
7849
7849
|
if (t.has(h))
|
|
7850
7850
|
return i(r, a, s, o, c);
|
|
7851
7851
|
const p = l.content;
|
|
7852
|
-
let
|
|
7852
|
+
let g, b = h || "text";
|
|
7853
7853
|
if (h && A.getLanguage(h))
|
|
7854
7854
|
try {
|
|
7855
|
-
|
|
7855
|
+
g = A.highlight(p, {
|
|
7856
7856
|
language: h,
|
|
7857
7857
|
ignoreIllegals: !0
|
|
7858
7858
|
}).value;
|
|
7859
7859
|
} catch {
|
|
7860
|
-
|
|
7860
|
+
g = le(p);
|
|
7861
7861
|
}
|
|
7862
7862
|
else if (h)
|
|
7863
7863
|
try {
|
|
7864
7864
|
const N = A.highlightAuto(p);
|
|
7865
|
-
|
|
7865
|
+
g = N.value, b = N.language || h;
|
|
7866
7866
|
} catch {
|
|
7867
|
-
|
|
7867
|
+
g = le(p);
|
|
7868
7868
|
}
|
|
7869
7869
|
else
|
|
7870
7870
|
try {
|
|
7871
7871
|
const N = A.highlightAuto(p);
|
|
7872
|
-
|
|
7872
|
+
g = N.value, b = N.language || "text";
|
|
7873
7873
|
} catch {
|
|
7874
|
-
|
|
7874
|
+
g = le(p);
|
|
7875
7875
|
}
|
|
7876
|
-
return `<div class="md-editor-codeblock"><div class="md-editor-codeblock-header"><span class="md-editor-codeblock-lights"><span class="md-editor-codeblock-dot md-editor-codeblock-dot--red"></span><span class="md-editor-codeblock-dot md-editor-codeblock-dot--yellow"></span><span class="md-editor-codeblock-dot md-editor-codeblock-dot--green"></span></span><span class="md-editor-codeblock-lang">${le(b)}</span><button type="button" class="md-editor-codeblock-copy" aria-label="Copy code">Copy</button></div><pre class="md-editor-codeblock-pre"><code class="language-${le(b)}">${
|
|
7876
|
+
return `<div class="md-editor-codeblock"><div class="md-editor-codeblock-header"><span class="md-editor-codeblock-lights"><span class="md-editor-codeblock-dot md-editor-codeblock-dot--red"></span><span class="md-editor-codeblock-dot md-editor-codeblock-dot--yellow"></span><span class="md-editor-codeblock-dot md-editor-codeblock-dot--green"></span></span><span class="md-editor-codeblock-lang">${le(b)}</span><button type="button" class="md-editor-codeblock-copy" aria-label="Copy code">Copy</button></div><pre class="md-editor-codeblock-pre"><code class="language-${le(b)}">${g}</code></pre></div>`;
|
|
7877
7877
|
};
|
|
7878
7878
|
}
|
|
7879
7879
|
const Ci = [".mp4", ".webm", ".ogg", ".mov", ".m4v", ".avi", ".mkv"], Mi = [
|
|
@@ -7955,8 +7955,8 @@ function Hi(n) {
|
|
|
7955
7955
|
}
|
|
7956
7956
|
if (!l) return !1;
|
|
7957
7957
|
if (r) return !0;
|
|
7958
|
-
const d = s[2] ?? et[o] ?? o, h = e.src.slice(e.bMarks[t + 1], e.bMarks[c]).trim(), p = n.render(h),
|
|
7959
|
-
return
|
|
7958
|
+
const d = s[2] ?? et[o] ?? o, h = e.src.slice(e.bMarks[t + 1], e.bMarks[c]).trim(), p = n.render(h), g = e.push("tips_block", "div", 0);
|
|
7959
|
+
return g.content = p, g.info = o, g.markup = d, e.line = c + 1, !0;
|
|
7960
7960
|
}), n.renderer.rules.tips_block = (e, t) => {
|
|
7961
7961
|
const i = e[t];
|
|
7962
7962
|
if (!i) return "";
|
|
@@ -7983,8 +7983,8 @@ function zi(n) {
|
|
|
7983
7983
|
if (((d = t[h]) == null ? void 0 : d.type) === "list_item_close") break;
|
|
7984
7984
|
}
|
|
7985
7985
|
if (c && c.content) {
|
|
7986
|
-
const h = c.content, p = /^\[\s*\]\s/.test(h),
|
|
7987
|
-
if (p ||
|
|
7986
|
+
const h = c.content, p = /^\[\s*\]\s/.test(h), g = /^\[\s*[xX]\s*\]\s/.test(h);
|
|
7987
|
+
if (p || g) {
|
|
7988
7988
|
const b = /^\[\s*(?:[xX])?\s*\]\s/;
|
|
7989
7989
|
if (c.content = h.replace(b, ""), c.children && c.children.length > 0) {
|
|
7990
7990
|
const S = c.children[0];
|
|
@@ -8086,8 +8086,8 @@ function Qi(n) {
|
|
|
8086
8086
|
for (const l of e) {
|
|
8087
8087
|
const d = l.match(Wi);
|
|
8088
8088
|
if (d) {
|
|
8089
|
-
const h = d[1] ?? "", p = h[0] ?? "",
|
|
8090
|
-
r ? p === a &&
|
|
8089
|
+
const h = d[1] ?? "", p = h[0] ?? "", g = h.length;
|
|
8090
|
+
r ? p === a && g >= s && Yi.test(l) && (r = !1) : (r = !0, a = p, s = g), i.push(l);
|
|
8091
8091
|
continue;
|
|
8092
8092
|
}
|
|
8093
8093
|
if (r || (!o && Zi.test(l) ? o = !0 : o && Vi.test(l) && (o = !1)), !r && !o && qi.test(l) && i.length > 0) {
|
|
@@ -8355,7 +8355,7 @@ function pr(n, e) {
|
|
|
8355
8355
|
}
|
|
8356
8356
|
return !(e.ctrlKey !== r || e.metaKey !== a || e.altKey !== s || e.shiftKey !== o || e.key.toLowerCase() !== i);
|
|
8357
8357
|
}
|
|
8358
|
-
function
|
|
8358
|
+
function mr(n) {
|
|
8359
8359
|
var i;
|
|
8360
8360
|
const e = ((i = navigator.platform) == null ? void 0 : i.toLowerCase().includes("mac")) ?? !1;
|
|
8361
8361
|
return n.split("-").map((r) => {
|
|
@@ -8431,7 +8431,7 @@ const nt = {
|
|
|
8431
8431
|
---
|
|
8432
8432
|
`, "", ""]
|
|
8433
8433
|
};
|
|
8434
|
-
class
|
|
8434
|
+
class gr {
|
|
8435
8435
|
constructor(e, t = {}) {
|
|
8436
8436
|
this.previewPane = null, this.incremental = null, this.toolbar = null, this.statusBar = null, this.activePopup = null, this.scheduledRender = null, this.scheduledWait = 0;
|
|
8437
8437
|
const i = typeof e == "string" ? document.querySelector(e) : e;
|
|
@@ -8631,7 +8631,7 @@ ${r}
|
|
|
8631
8631
|
var a;
|
|
8632
8632
|
(a = this.activePopup) == null || a.destroy();
|
|
8633
8633
|
const t = new Q(e, {
|
|
8634
|
-
title: "
|
|
8634
|
+
title: "PowerDuck Markdown Editor",
|
|
8635
8635
|
theme: this.theme,
|
|
8636
8636
|
fields: [],
|
|
8637
8637
|
onSubmit: () => {
|
|
@@ -8646,7 +8646,7 @@ ${r}
|
|
|
8646
8646
|
{ label: "Mindmap", hint: "```mindmap fenced block with # headings" },
|
|
8647
8647
|
{ label: "Callout", hint: ":::warning Title ...content... :::" }
|
|
8648
8648
|
];
|
|
8649
|
-
i.innerHTML = '<div class="md-editor-help-list">' + this.shortcuts.map(
|
|
8649
|
+
i.innerHTML = '<div class="md-editor-help-brand"><div class="md-editor-help-brand-name">PowerDuck Markdown Editor</div><div class="md-editor-help-brand-tagline">The fast, embeddable markdown editor for modern apps.</div></div><div class="md-editor-help-section-title">Keyboard Shortcuts</div><div class="md-editor-help-list">' + this.shortcuts.map(
|
|
8650
8650
|
(o) => `<div class="md-editor-help-row">
|
|
8651
8651
|
<span class="md-editor-help-desc">${o.description}</span>
|
|
8652
8652
|
<span class="md-editor-help-keys">${nr(o.key)}</span>
|
|
@@ -8656,7 +8656,7 @@ ${r}
|
|
|
8656
8656
|
<span class="md-editor-help-desc">${o.label}</span>
|
|
8657
8657
|
<span class="md-editor-help-syntax">${o.hint}</span>
|
|
8658
8658
|
</div>`
|
|
8659
|
-
).join("") + "</div>
|
|
8659
|
+
).join("") + '</div><div class="md-editor-help-footer"><a href="https://www.powerduck.com" target="_blank" rel="noopener noreferrer" class="md-editor-help-link">powerduck.com</a></div>';
|
|
8660
8660
|
}
|
|
8661
8661
|
const r = t.el.querySelector(".md-editor-popup-footer");
|
|
8662
8662
|
r && r.remove(), this.activePopup = t, this.activePopup.show();
|
|
@@ -8972,7 +8972,7 @@ export {
|
|
|
8972
8972
|
rn as CodeEditor,
|
|
8973
8973
|
tr as DEFAULT_SHORTCUTS,
|
|
8974
8974
|
Ji as IncrementalRenderer,
|
|
8975
|
-
|
|
8975
|
+
gr as MarkdownEditor,
|
|
8976
8976
|
Q as Popup,
|
|
8977
8977
|
It as Renderer,
|
|
8978
8978
|
Gi as StatusBar,
|
|
@@ -8982,7 +8982,7 @@ export {
|
|
|
8982
8982
|
tt as countText,
|
|
8983
8983
|
ji as debounce,
|
|
8984
8984
|
Ri as extractYouTubeId,
|
|
8985
|
-
|
|
8985
|
+
mr as formatShortcut,
|
|
8986
8986
|
nr as formatShortcutHtml,
|
|
8987
8987
|
R as icons,
|
|
8988
8988
|
je as imageMarkdown,
|