@slidev/parser 0.47.1 → 0.47.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/{chunk-3PHEOYPJ.mjs → chunk-3UOELSP3.mjs} +5 -0
- package/dist/core.mjs +1 -1
- package/dist/fs.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
|
@@ -286,21 +286,25 @@ function safeParseYAML(str) {
|
|
|
286
286
|
}
|
|
287
287
|
function matter(code) {
|
|
288
288
|
let type;
|
|
289
|
+
let raw;
|
|
289
290
|
const data = {};
|
|
290
291
|
let content = code.replace(/^---.*\r?\n([\s\S]*?)---/, (_, f) => {
|
|
291
292
|
type = "frontmatter";
|
|
293
|
+
raw = f;
|
|
292
294
|
Object.assign(data, safeParseYAML(f));
|
|
293
295
|
return "";
|
|
294
296
|
});
|
|
295
297
|
if (type !== "frontmatter") {
|
|
296
298
|
content = content.replace(/^\s*```ya?ml([\s\S]*?)```/, (_, d) => {
|
|
297
299
|
type = "yaml";
|
|
300
|
+
raw = d;
|
|
298
301
|
Object.assign(data, safeParseYAML(d));
|
|
299
302
|
return "";
|
|
300
303
|
});
|
|
301
304
|
}
|
|
302
305
|
return {
|
|
303
306
|
type,
|
|
307
|
+
raw,
|
|
304
308
|
data,
|
|
305
309
|
content
|
|
306
310
|
};
|
|
@@ -344,6 +348,7 @@ function parseSlide(raw) {
|
|
|
344
348
|
content,
|
|
345
349
|
frontmatter,
|
|
346
350
|
frontmatterStyle: matterResult.type,
|
|
351
|
+
frontmatterRaw: matterResult.raw,
|
|
347
352
|
note
|
|
348
353
|
};
|
|
349
354
|
}
|
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.47.
|
|
3
|
+
"version": "0.47.3",
|
|
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.47.
|
|
43
|
+
"@slidev/types": "0.47.3"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "rimraf dist && tsup src/index.ts src/core.ts src/fs.ts",
|