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