@slidev/parser 0.46.3 → 0.47.1
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/{chunk-GX6I4MMD.mjs → chunk-3PHEOYPJ.mjs} +7 -53
- package/dist/core.mjs +1 -1
- package/dist/fs.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
|
@@ -40,56 +40,6 @@ function objectMap(obj, fn) {
|
|
|
40
40
|
Object.entries(obj).map(([k, v]) => fn(k, v)).filter(notNullish)
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
|
-
var Node = class {
|
|
44
|
-
value;
|
|
45
|
-
next;
|
|
46
|
-
constructor(value) {
|
|
47
|
-
this.value = value;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
var Queue = class {
|
|
51
|
-
#head;
|
|
52
|
-
#tail;
|
|
53
|
-
#size;
|
|
54
|
-
constructor() {
|
|
55
|
-
this.clear();
|
|
56
|
-
}
|
|
57
|
-
enqueue(value) {
|
|
58
|
-
const node = new Node(value);
|
|
59
|
-
if (this.#head) {
|
|
60
|
-
this.#tail.next = node;
|
|
61
|
-
this.#tail = node;
|
|
62
|
-
} else {
|
|
63
|
-
this.#head = node;
|
|
64
|
-
this.#tail = node;
|
|
65
|
-
}
|
|
66
|
-
this.#size++;
|
|
67
|
-
}
|
|
68
|
-
dequeue() {
|
|
69
|
-
const current = this.#head;
|
|
70
|
-
if (!current) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
this.#head = this.#head.next;
|
|
74
|
-
this.#size--;
|
|
75
|
-
return current.value;
|
|
76
|
-
}
|
|
77
|
-
clear() {
|
|
78
|
-
this.#head = void 0;
|
|
79
|
-
this.#tail = void 0;
|
|
80
|
-
this.#size = 0;
|
|
81
|
-
}
|
|
82
|
-
get size() {
|
|
83
|
-
return this.#size;
|
|
84
|
-
}
|
|
85
|
-
*[Symbol.iterator]() {
|
|
86
|
-
let current = this.#head;
|
|
87
|
-
while (current) {
|
|
88
|
-
yield current.value;
|
|
89
|
-
current = current.next;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
43
|
var VOID = Symbol("p-void");
|
|
94
44
|
|
|
95
45
|
// src/utils.ts
|
|
@@ -134,7 +84,7 @@ function getDefaultConfig() {
|
|
|
134
84
|
download: false,
|
|
135
85
|
export: {},
|
|
136
86
|
info: false,
|
|
137
|
-
highlighter: "
|
|
87
|
+
highlighter: "shiki",
|
|
138
88
|
lineNumbers: false,
|
|
139
89
|
colorSchema: "auto",
|
|
140
90
|
routerMode: "history",
|
|
@@ -179,6 +129,10 @@ function resolveConfig(headmatter, themeMeta = {}, filepath, verify = false) {
|
|
|
179
129
|
...headmatter?.htmlAttrs
|
|
180
130
|
}
|
|
181
131
|
};
|
|
132
|
+
if (config.highlighter === "shikiji") {
|
|
133
|
+
console.warn(`[slidev] "shikiji" is merged back to "shiki", you can safely change it "highlighter: shiki"`);
|
|
134
|
+
config.highlighter = "shiki";
|
|
135
|
+
}
|
|
182
136
|
if (config.colorSchema !== "dark" && config.colorSchema !== "light")
|
|
183
137
|
config.colorSchema = "auto";
|
|
184
138
|
if (themeColorSchema && config.colorSchema === "auto")
|
|
@@ -189,13 +143,13 @@ function resolveConfig(headmatter, themeMeta = {}, filepath, verify = false) {
|
|
|
189
143
|
return config;
|
|
190
144
|
}
|
|
191
145
|
function verifyConfig(config, themeMeta = {}, warn = (v) => console.warn(`[slidev] ${v}`)) {
|
|
192
|
-
const themeHightlighter = ["prism", "shiki"
|
|
146
|
+
const themeHightlighter = ["prism", "shiki"].includes(themeMeta.highlighter || "") ? themeMeta.highlighter : void 0;
|
|
193
147
|
const themeColorSchema = ["light", "dark"].includes(themeMeta.colorSchema || "") ? themeMeta.colorSchema : void 0;
|
|
194
148
|
if (themeColorSchema && config.colorSchema !== themeColorSchema)
|
|
195
149
|
warn(`Color schema "${config.colorSchema}" does not supported by the theme`);
|
|
196
150
|
if (themeHightlighter && config.highlighter !== themeHightlighter)
|
|
197
151
|
warn(`Syntax highlighter "${config.highlighter}" does not supported by the theme`);
|
|
198
|
-
if (!["
|
|
152
|
+
if (!["unocss", void 0].includes(config.css)) {
|
|
199
153
|
warn(`Unsupported Atomic CSS engine "${config.css}", fallback to UnoCSS`);
|
|
200
154
|
config.css = "unocss";
|
|
201
155
|
}
|
package/dist/core.mjs
CHANGED
package/dist/fs.mjs
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/parser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.1",
|
|
4
4
|
"description": "Markdown parser for Slidev",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"js-yaml": "^4.1.0",
|
|
43
|
-
"@slidev/types": "0.
|
|
43
|
+
"@slidev/types": "0.47.1"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "rimraf dist && tsup src/index.ts src/core.ts src/fs.ts",
|