@wenyan-md/core 1.0.8 → 1.0.10

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/core.js CHANGED
@@ -1,10 +1,10 @@
1
- import { marked as m } from "marked";
1
+ import { marked as d } from "marked";
2
2
  import { markedHighlight as H } from "marked-highlight";
3
3
  import x from "highlight.js";
4
4
  import P from "front-matter";
5
5
  import * as f from "css-tree";
6
- import { mathjax as V } from "mathjax-full/js/mathjax.js";
7
- import { TeX as j } from "mathjax-full/js/input/tex.js";
6
+ import { mathjax as j } from "mathjax-full/js/mathjax.js";
7
+ import { TeX as V } from "mathjax-full/js/input/tex.js";
8
8
  import { SVG as q } from "mathjax-full/js/output/svg.js";
9
9
  import { liteAdaptor as I } from "mathjax-full/js/adaptors/liteAdaptor.js";
10
10
  import { RegisterHTMLHandler as S } from "mathjax-full/js/handlers/html.js";
@@ -16,40 +16,40 @@ const z = {
16
16
  displayMath: [["$$", "$$"], ["\\[", "\\]"]],
17
17
  processEscapes: !0,
18
18
  packages: R
19
- }, N = {
19
+ }, E = {
20
20
  fontCache: "none"
21
21
  };
22
- let g;
23
- if (!g) {
24
- g = I();
22
+ let m;
23
+ if (!m) {
24
+ m = I();
25
25
  try {
26
- S(g);
26
+ S(m);
27
27
  } catch {
28
28
  }
29
29
  }
30
- S(g);
31
- const D = new j(z), E = new q(N);
32
- function A(r, n) {
33
- const a = r.display ? "section" : "span", e = r.display ? "block-equation" : "inline-equation";
34
- r.typesetRoot = n.adaptor.node(a, { class: e }, [r.typesetRoot]);
30
+ S(m);
31
+ const N = new V(z), D = new q(E);
32
+ function A(t, i) {
33
+ const l = t.display ? "section" : "span", o = t.display ? "block-equation" : "inline-equation";
34
+ t.typesetRoot = i.adaptor.node(l, { class: o }, [t.typesetRoot]);
35
35
  }
36
- async function F(r) {
36
+ async function F(t) {
37
37
  try {
38
- const n = V.document(r, {
39
- InputJax: D,
40
- OutputJax: E,
38
+ const i = j.document(t, {
39
+ InputJax: N,
40
+ OutputJax: D,
41
41
  renderActions: {
42
- addContainer: [190, (e) => {
43
- for (const s of e.math)
44
- A(s, e);
42
+ addContainer: [190, (o) => {
43
+ for (const r of o.math)
44
+ A(r, o);
45
45
  }, A]
46
46
  }
47
47
  });
48
- n.render();
49
- const a = g.body(n.document);
50
- return g.innerHTML(a);
51
- } catch (n) {
52
- throw console.error("Error rendering MathJax:", n), n;
48
+ i.render();
49
+ const l = m.body(i.document);
50
+ return m.innerHTML(l);
51
+ } catch (i) {
52
+ throw console.error("Error rendering MathJax:", i), i;
53
53
  }
54
54
  }
55
55
  const G = `#wenyan pre::before {
@@ -61,85 +61,86 @@ const G = `#wenyan pre::before {
61
61
  height: 16px;
62
62
  }`, ie = "ui-serif, Georgia, Cambria, 'Noto Serif', 'Times New Roman', serif", B = "ui-sans-serif, system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', 'Roboto', sans-serif", L = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace";
63
63
  function le() {
64
- m.use(
65
- H({
66
- langPrefix: "hljs language-",
67
- highlight: function(e, s) {
68
- return s = x.getLanguage(s) ? s : "plaintext", x.highlight(e, { language: s }).value;
69
- }
70
- })
71
- );
72
- const r = {
64
+ const t = H({
65
+ emptyLangClass: "hljs",
66
+ langPrefix: "hljs language-",
67
+ highlight: function(r, n, s) {
68
+ const e = x.getLanguage(n) ? n : "plaintext";
69
+ return x.highlight(r, { language: e }).value;
70
+ }
71
+ });
72
+ d.use(t);
73
+ const i = {
73
74
  name: "attributeImage",
74
75
  level: "inline",
75
- start(e) {
76
- return e.indexOf("![");
76
+ start(r) {
77
+ return r.indexOf("![");
77
78
  },
78
- tokenizer(e) {
79
- const o = /^!\[([^\]]*)\]\(([^)]+)\)\{(.*?)\}/.exec(e);
80
- if (o)
79
+ tokenizer(r) {
80
+ const s = /^!\[([^\]]*)\]\(([^)]+)\)\{(.*?)\}/.exec(r);
81
+ if (s)
81
82
  return {
82
83
  type: "attributeImage",
83
- raw: o[0],
84
- alt: o[1],
85
- href: o[2],
86
- attrs: o[3]
84
+ raw: s[0],
85
+ alt: s[1],
86
+ href: s[2],
87
+ attrs: s[3]
87
88
  };
88
89
  },
89
- renderer(e) {
90
- const s = J(e.attrs), o = Array.from(s).map(
91
- ([l, t]) => /^\d+$/.test(t) ? `${l}:${t}px` : `${l}:${t}`
90
+ renderer(r) {
91
+ const n = J(r.attrs), s = Array.from(n).map(
92
+ ([e, a]) => /^\d+$/.test(a) ? `${e}:${a}px` : `${e}:${a}`
92
93
  ).join("; ");
93
- return `<img src="${e.href}" alt="${e.alt}" style="${o}">`;
94
+ return `<img src="${r.href}" alt="${r.alt || ""}" title="${r.alt || ""}" style="${s}">`;
94
95
  }
95
96
  };
96
- m.use({ extensions: [r] });
97
- const n = m.Renderer, a = m.Parser;
98
- n.heading = function(e) {
99
- const s = a.parseInline(e.tokens), o = e.depth;
100
- return `<h${o}><span>${s}</span></h${o}>
97
+ d.use({ extensions: [i] });
98
+ const l = d.Renderer, o = d.Parser;
99
+ l.heading = function(r) {
100
+ const n = o.parseInline(r.tokens), s = r.depth;
101
+ return `<h${s}><span>${n}</span></h${s}>
101
102
  `;
102
- }, n.paragraph = function(e) {
103
- const s = e.text;
104
- return s.length > 4 && (/\$\$[\s\S]*?\$\$/g.test(s) || /\\\[[\s\S]*?\\\]/g.test(s)) ? `${s}
105
- ` : `<p>${a.parseInline(e.tokens)}</p>
103
+ }, l.paragraph = function(r) {
104
+ const n = r.text;
105
+ return n.length > 4 && (/\$\$[\s\S]*?\$\$/g.test(n) || /\\\[[\s\S]*?\\\]/g.test(n)) ? `${n}
106
+ ` : `<p>${o.parseInline(r.tokens)}</p>
106
107
  `;
107
- }, n.image = function(e, s, o) {
108
- return `<img src="${e.href}" alt="${o || ""}" title="${s || o || ""}">`;
109
- }, m.use({ renderer: n });
108
+ }, l.image = function(r, n, s) {
109
+ return `<img src="${r.href}" alt="${r.text || ""}" title="${r.text || ""}">`;
110
+ }, d.use({ renderer: l });
110
111
  }
111
- function J(r) {
112
- const n = /* @__PURE__ */ new Map();
113
- return r.split(/\s+/).forEach((a) => {
114
- const [e, s] = a.split("=");
115
- e && s && n.set(e, s.replace(/^["']|["']$/g, ""));
116
- }), n;
112
+ function J(t) {
113
+ const i = /* @__PURE__ */ new Map();
114
+ return t.split(/\s+/).forEach((l) => {
115
+ const [o, r] = l.split("=");
116
+ o && r && i.set(o, r.replace(/^["']|["']$/g, ""));
117
+ }), i;
117
118
  }
118
- function ce(r) {
119
- const { attributes: n, body: a } = P(r), e = {};
120
- let s = "";
121
- const { title: o, description: l, cover: t } = n;
122
- return o && (e.title = o), l && (s += "> " + l + `
119
+ function ce(t) {
120
+ const { attributes: i, body: l } = P(t), o = {};
121
+ let r = "";
122
+ const { title: n, description: s, cover: e } = i;
123
+ return n && (o.title = n), s && (r += "> " + s + `
123
124
 
124
- `, e.description = l), t && (e.cover = t), e.body = s + a, e;
125
+ `, o.description = s), e && (o.cover = e), o.body = r + l, o;
125
126
  }
126
- async function pe(r) {
127
- const n = m.parse(r);
128
- return await F(n);
127
+ async function pe(t) {
128
+ const i = d.parse(t);
129
+ return await F(i);
129
130
  }
130
- async function fe(r, n, a, e, s) {
131
- let o = b.default;
132
- if (n && (o = b[n], o || (o = Object.values(b).find(
133
- (c) => c.name.toLowerCase() === n.toLowerCase()
134
- ))), !o)
131
+ async function fe(t, i, l, o = !0, r = !0) {
132
+ let n = b.default;
133
+ if (i && (n = b[i], n || (n = Object.values(b).find(
134
+ (c) => c.name.toLowerCase() === i.toLowerCase()
135
+ ))), !n)
135
136
  throw new Error("主题不存在");
136
- if (!(a in C))
137
+ if (!(l in C))
137
138
  throw new Error("代码块主题不存在");
138
- const l = U(await o.getCss()), i = await C[a].getCss();
139
- return O(r, l, i, e, s);
139
+ const s = U(await n.getCss()), a = await C[l].getCss();
140
+ return O(t, s, a, o, r);
140
141
  }
141
- async function O(r, n, a, e, s) {
142
- s && Y(!1, r), n = W(n, {
142
+ async function O(t, i, l, o = !0, r = !0) {
143
+ r && Y(!1, t), i = W(i, {
143
144
  "#wenyan pre code": [
144
145
  {
145
146
  property: "font-family",
@@ -155,39 +156,39 @@ async function O(r, n, a, e, s) {
155
156
  }
156
157
  ]
157
158
  });
158
- const o = f.parse(n, {
159
+ const n = f.parse(i, {
159
160
  context: "stylesheet",
160
161
  positions: !1,
161
162
  parseAtrulePrelude: !1,
162
163
  parseCustomProperty: !1,
163
164
  parseValue: !1
164
- }), l = f.parse(a, {
165
+ }), s = f.parse(l, {
165
166
  context: "stylesheet",
166
167
  positions: !1,
167
168
  parseAtrulePrelude: !1,
168
169
  parseCustomProperty: !1,
169
170
  parseValue: !1
170
171
  });
171
- if (o.children.appendList(l.children), e) {
172
- const i = f.parse(G, {
172
+ if (n.children.appendList(s.children), o) {
173
+ const a = f.parse(G, {
173
174
  context: "stylesheet",
174
175
  positions: !1,
175
176
  parseAtrulePrelude: !1,
176
177
  parseCustomProperty: !1,
177
178
  parseValue: !1
178
179
  });
179
- o.children.appendList(i.children);
180
+ n.children.appendList(a.children);
180
181
  }
181
- f.walk(o, {
182
+ f.walk(n, {
182
183
  visit: "Rule",
183
- enter(i, c, p) {
184
- const u = i.prelude.children;
185
- u && u.forEach((d) => {
186
- const h = f.generate(d), $ = i.block.children.toArray();
184
+ enter(a, c, p) {
185
+ const u = a.prelude.children;
186
+ u && u.forEach((g) => {
187
+ const h = f.generate(g), $ = a.block.children.toArray();
187
188
  h === "#wenyan" ? $.forEach((y) => {
188
189
  const v = f.generate(y.value);
189
- r.style[y.property] = v;
190
- }) : r.querySelectorAll(h).forEach((v) => {
190
+ t.style[y.property] = v;
191
+ }) : t.querySelectorAll(h).forEach((v) => {
191
192
  $.forEach((w) => {
192
193
  const T = f.generate(w.value);
193
194
  v.style[w.property] = T;
@@ -196,81 +197,81 @@ async function O(r, n, a, e, s) {
196
197
  });
197
198
  }
198
199
  });
199
- let t = r.querySelectorAll("mjx-container");
200
- return t.forEach((i) => {
201
- const c = i.querySelector("svg");
200
+ let e = t.querySelectorAll("mjx-container");
201
+ return e.forEach((a) => {
202
+ const c = a.querySelector("svg");
202
203
  c.style.width = c.getAttribute("width"), c.style.height = c.getAttribute("height"), c.removeAttribute("width"), c.removeAttribute("height");
203
- const p = i.parentElement;
204
- i.remove(), p.appendChild(c), p.classList.contains("block-equation") && p.setAttribute("style", "text-align: center; margin-bottom: 1rem;");
205
- }), t = r.querySelectorAll("pre code"), t.forEach((i) => {
206
- i.innerHTML = i.innerHTML.replace(/\n/g, "<br>").replace(/(>[^<]+)|(^[^<]+)/g, (c) => c.replace(/\s/g, "&nbsp;"));
207
- }), t = r.querySelectorAll("h1, h2, h3, h4, h5, h6, blockquote, pre"), t.forEach((i) => {
204
+ const p = a.parentElement;
205
+ a.remove(), p.appendChild(c), p.classList.contains("block-equation") && p.setAttribute("style", "text-align: center; margin-bottom: 1rem;");
206
+ }), e = t.querySelectorAll("pre code"), e.forEach((a) => {
207
+ a.innerHTML = a.innerHTML.replace(/\n/g, "<br>").replace(/(>[^<]+)|(^[^<]+)/g, (c) => c.replace(/\s/g, "&nbsp;"));
208
+ }), e = t.querySelectorAll("h1, h2, h3, h4, h5, h6, blockquote, pre"), e.forEach((a) => {
208
209
  const c = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
209
- f.walk(o, {
210
+ f.walk(n, {
210
211
  visit: "Rule",
211
212
  enter(u) {
212
- const d = f.generate(u.prelude), h = i.tagName.toLowerCase();
213
- d.includes(`${h}::after`) ? M(u, c) : d.includes(`${h}::before`) && M(u, p);
213
+ const g = f.generate(u.prelude), h = a.tagName.toLowerCase();
214
+ g.includes(`${h}::after`) ? M(u, c) : g.includes(`${h}::before`) && M(u, p);
214
215
  }
215
- }), c.size > 0 && i.appendChild(k(c, r.ownerDocument)), p.size > 0 && i.insertBefore(k(p, r.ownerDocument), i.firstChild);
216
- }), r.setAttribute("data-provider", "WenYan"), `${r.outerHTML.replace(/class="mjx-solid"/g, 'fill="none" stroke-width="70"')}`;
216
+ }), c.size > 0 && a.appendChild(k(c, t.ownerDocument)), p.size > 0 && a.insertBefore(k(p, t.ownerDocument), a.firstChild);
217
+ }), t.setAttribute("data-provider", "WenYan"), `${t.outerHTML.replace(/class="mjx-solid"/g, 'fill="none" stroke-width="70"')}`;
217
218
  }
218
- function U(r) {
219
- const n = /--([a-zA-Z0-9\-]+):\s*([^;()]*\((?:[^()]*|\([^()]*\))*\)[^;()]*|[^;]+);/g, a = /var\(--([a-zA-Z0-9\-]+)\)/g, e = {};
220
- let s;
221
- for (; (s = n.exec(r)) !== null; ) {
222
- const t = s[1], i = s[2].trim().replaceAll(`
219
+ function U(t) {
220
+ const i = /--([a-zA-Z0-9\-]+):\s*([^;()]*\((?:[^()]*|\([^()]*\))*\)[^;()]*|[^;]+);/g, l = /var\(--([a-zA-Z0-9\-]+)\)/g, o = {};
221
+ let r;
222
+ for (; (r = i.exec(t)) !== null; ) {
223
+ const e = r[1], a = r[2].trim().replaceAll(`
223
224
  `, "");
224
- e[t] = i;
225
+ o[e] = a;
225
226
  }
226
- e["sans-serif-font"] || (e["sans-serif-font"] = B), e["monospace-font"] || (e["monospace-font"] = L);
227
- function o(t, i, c = /* @__PURE__ */ new Set()) {
228
- if (c.has(t)) return t;
229
- c.add(t);
230
- let p = t, u;
231
- for (; (u = a.exec(p)) !== null; ) {
232
- const d = u[1];
233
- if (i[d]) {
234
- const h = o(i[d], i, c);
227
+ o["sans-serif-font"] || (o["sans-serif-font"] = B), o["monospace-font"] || (o["monospace-font"] = L);
228
+ function n(e, a, c = /* @__PURE__ */ new Set()) {
229
+ if (c.has(e)) return e;
230
+ c.add(e);
231
+ let p = e, u;
232
+ for (; (u = l.exec(p)) !== null; ) {
233
+ const g = u[1];
234
+ if (a[g]) {
235
+ const h = n(a[g], a, c);
235
236
  p = p.replace(u[0], h);
236
237
  }
237
238
  }
238
239
  return p;
239
240
  }
240
- for (const t in e) {
241
- const i = o(e[t], e);
242
- e[t] = i;
241
+ for (const e in o) {
242
+ const a = n(o[e], o);
243
+ o[e] = a;
243
244
  }
244
- let l = r;
245
- for (; (s = a.exec(r)) !== null; ) {
246
- const t = s[1];
247
- e[t] && (l = l.replace(s[0], e[t]));
245
+ let s = t;
246
+ for (; (r = l.exec(t)) !== null; ) {
247
+ const e = r[1];
248
+ o[e] && (s = s.replace(r[0], o[e]));
248
249
  }
249
- return l.replace(/:root\s*\{[^}]*\}/g, "");
250
+ return s.replace(/:root\s*\{[^}]*\}/g, "");
250
251
  }
251
- function W(r, n) {
252
- const a = f.parse(r, {
252
+ function W(t, i) {
253
+ const l = f.parse(t, {
253
254
  context: "stylesheet",
254
255
  positions: !1,
255
256
  parseAtrulePrelude: !1,
256
257
  parseCustomProperty: !1,
257
258
  parseValue: !1
258
259
  });
259
- return f.walk(a, {
260
+ return f.walk(l, {
260
261
  visit: "Rule",
261
- leave: (e, s, o) => {
262
- if (e.prelude.type !== "SelectorList") return;
263
- const l = e.prelude.children.toArray().map((t) => f.generate(t));
264
- if (l) {
265
- const t = l[0], i = n[t];
266
- if (!i) return;
267
- for (const { property: c, value: p, append: u } of i)
262
+ leave: (o, r, n) => {
263
+ if (o.prelude.type !== "SelectorList") return;
264
+ const s = o.prelude.children.toArray().map((e) => f.generate(e));
265
+ if (s) {
266
+ const e = s[0], a = i[e];
267
+ if (!a) return;
268
+ for (const { property: c, value: p, append: u } of a)
268
269
  if (p) {
269
- let d = !1;
270
- f.walk(e.block, (h) => {
271
- h.type === "Declaration" && h.property === c && (h.value = f.parse(p, { context: "value" }), d = !0);
272
- }), !d && u && e.block.children.prepend(
273
- o.createItem({
270
+ let g = !1;
271
+ f.walk(o.block, (h) => {
272
+ h.type === "Declaration" && h.property === c && (h.value = f.parse(p, { context: "value" }), g = !0);
273
+ }), !g && u && o.block.children.prepend(
274
+ n.createItem({
274
275
  type: "Declaration",
275
276
  property: c,
276
277
  value: f.parse(p, { context: "value" })
@@ -279,52 +280,52 @@ function W(r, n) {
279
280
  }
280
281
  }
281
282
  }
282
- }), f.generate(a);
283
+ }), f.generate(l);
283
284
  }
284
- function M(r, n) {
285
- f.walk(r.block, {
285
+ function M(t, i) {
286
+ f.walk(t.block, {
286
287
  visit: "Declaration",
287
- enter(a) {
288
- const e = a.property, s = f.generate(a.value);
289
- n.set(e, s);
288
+ enter(l) {
289
+ const o = l.property, r = f.generate(l.value);
290
+ i.set(o, r);
290
291
  }
291
292
  });
292
293
  }
293
- function k(r, n) {
294
- const a = n.createElement("section");
295
- r.get("content") && (a.textContent = r.get("content").replace(/['"]/g, ""), r.delete("content"));
296
- for (const [o, l] of r)
297
- if (l.includes("url(")) {
298
- const t = l.match(/data:image\/svg\+xml;utf8,(.*<\/svg>)/), i = l.match(/data:image\/svg\+xml;base64,([^"'\)]*)["']?\)/), c = l.match(/(?:"|')?(https?[^"'\)]*)(?:"|')?\)/);
299
- if (t) {
300
- const p = decodeURIComponent(t[1]);
301
- a.innerHTML = p;
302
- } else if (i) {
303
- const p = atob(i[1]);
304
- a.innerHTML = p;
294
+ function k(t, i) {
295
+ const l = i.createElement("section");
296
+ t.get("content") && (l.textContent = t.get("content").replace(/['"]/g, ""), t.delete("content"));
297
+ for (const [n, s] of t)
298
+ if (s.includes("url(")) {
299
+ const e = s.match(/data:image\/svg\+xml;utf8,(.*<\/svg>)/), a = s.match(/data:image\/svg\+xml;base64,([^"'\)]*)["']?\)/), c = s.match(/(?:"|')?(https?[^"'\)]*)(?:"|')?\)/);
300
+ if (e) {
301
+ const p = decodeURIComponent(e[1]);
302
+ l.innerHTML = p;
303
+ } else if (a) {
304
+ const p = atob(a[1]);
305
+ l.innerHTML = p;
305
306
  } else if (c) {
306
- const p = n.createElement("img");
307
- p.src = c[1], p.setAttribute("style", "vertical-align: top;"), a.appendChild(p);
307
+ const p = i.createElement("img");
308
+ p.src = c[1], p.setAttribute("style", "vertical-align: top;"), l.appendChild(p);
308
309
  }
309
- r.delete(o);
310
+ t.delete(n);
310
311
  }
311
- const s = Array.from(r.entries()).map(([o, l]) => `${o}: ${l}`).join("; ");
312
- return a.style.cssText = s, a;
312
+ const r = Array.from(t.entries()).map(([n, s]) => `${n}: ${s}`).join("; ");
313
+ return l.style.cssText = r, l;
313
314
  }
314
- function Y(r, n) {
315
- let a = [], e = 0;
316
- if (n.querySelectorAll("a[href]").forEach((o) => {
317
- const l = o.textContent || o.innerText, t = o.getAttribute("href");
318
- a.push([++e, l, t]);
319
- const i = n.ownerDocument.createElement("sup");
320
- i.setAttribute("class", "footnote"), i.innerHTML = `[${e}]`, o.after(i);
321
- }), e > 0)
322
- if (r) {
323
- const l = `<h3>引用链接</h3><div id="footnotes"><ul>${a.map((t) => t[1] === t[2] ? `<li id="#footnote-${t[0]}">[${t[0]}]: <i>${t[1]}</i></li>` : `<li id="#footnote-${t[0]}">[${t[0]}] ${t[1]}: <i>${t[2]}</i></li>`).join("")}</ul></div>`;
324
- n.innerHTML += l;
315
+ function Y(t, i) {
316
+ let l = [], o = 0;
317
+ if (i.querySelectorAll("a[href]").forEach((n) => {
318
+ const s = n.textContent || n.innerText, e = n.getAttribute("href");
319
+ l.push([++o, s, e]);
320
+ const a = i.ownerDocument.createElement("sup");
321
+ a.setAttribute("class", "footnote"), a.innerHTML = `[${o}]`, n.after(a);
322
+ }), o > 0)
323
+ if (t) {
324
+ const s = `<h3>引用链接</h3><div id="footnotes"><ul>${l.map((e) => e[1] === e[2] ? `<li id="#footnote-${e[0]}">[${e[0]}]: <i>${e[1]}</i></li>` : `<li id="#footnote-${e[0]}">[${e[0]}] ${e[1]}: <i>${e[2]}</i></li>`).join("")}</ul></div>`;
325
+ i.innerHTML += s;
325
326
  } else {
326
- const l = `<h3>引用链接</h3><section id="footnotes">${a.map((t) => t[1] === t[2] ? `<p><span class="footnote-num">[${t[0]}]</span><span class="footnote-txt"><i>${t[1]}</i></span></p>` : `<p><span class="footnote-num">[${t[0]}]</span><span class="footnote-txt">${t[1]}: <i>${t[2]}</i></span></p>`).join("")}</section>`;
327
- n.innerHTML += l;
327
+ const s = `<h3>引用链接</h3><section id="footnotes">${l.map((e) => e[1] === e[2] ? `<p><span class="footnote-num">[${e[0]}]</span><span class="footnote-txt"><i>${e[1]}</i></span></p>` : `<p><span class="footnote-num">[${e[0]}]</span><span class="footnote-txt">${e[1]}: <i>${e[2]}</i></span></p>`).join("")}</section>`;
328
+ i.innerHTML += s;
328
329
  }
329
330
  }
330
331
  export {