@wenyan-md/core 1.0.11 → 1.0.13

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