@slidev/parser 0.40.5 → 0.40.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/{chunk-GZEQIAFS.mjs → chunk-UJGTNRWR.mjs} +2 -1
- package/dist/{chunk-2BY3EOMX.js → chunk-VG22VYSB.js} +2 -1
- package/dist/core.js +2 -2
- package/dist/core.mjs +1 -1
- package/dist/fs.js +7 -7
- package/dist/fs.mjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
|
@@ -397,12 +397,13 @@ function parseSlide(raw) {
|
|
|
397
397
|
let level;
|
|
398
398
|
if (frontmatter.title || frontmatter.name) {
|
|
399
399
|
title = frontmatter.title || frontmatter.name;
|
|
400
|
-
level = frontmatter.level || 1;
|
|
401
400
|
} else {
|
|
402
401
|
const match = content.match(/^(#+) (.*)$/m);
|
|
403
402
|
title = (_a = match == null ? void 0 : match[2]) == null ? void 0 : _a.trim();
|
|
404
403
|
level = (_b = match == null ? void 0 : match[1]) == null ? void 0 : _b.length;
|
|
405
404
|
}
|
|
405
|
+
if (frontmatter.level)
|
|
406
|
+
level = frontmatter.level || 1;
|
|
406
407
|
return {
|
|
407
408
|
raw,
|
|
408
409
|
title,
|
|
@@ -397,12 +397,13 @@ function parseSlide(raw) {
|
|
|
397
397
|
let level;
|
|
398
398
|
if (frontmatter.title || frontmatter.name) {
|
|
399
399
|
title = frontmatter.title || frontmatter.name;
|
|
400
|
-
level = frontmatter.level || 1;
|
|
401
400
|
} else {
|
|
402
401
|
const match = content.match(/^(#+) (.*)$/m);
|
|
403
402
|
title = (_a = match == null ? void 0 : match[2]) == null ? void 0 : _a.trim();
|
|
404
403
|
level = (_b = match == null ? void 0 : match[1]) == null ? void 0 : _b.length;
|
|
405
404
|
}
|
|
405
|
+
if (frontmatter.level)
|
|
406
|
+
level = frontmatter.level || 1;
|
|
406
407
|
return {
|
|
407
408
|
raw,
|
|
408
409
|
title,
|
package/dist/core.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkVG22VYSBjs = require('./chunk-VG22VYSB.js');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
@@ -33,4 +33,4 @@ var _chunk2BY3EOMXjs = require('./chunk-2BY3EOMX.js');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
exports.detectFeatures =
|
|
36
|
+
exports.detectFeatures = _chunkVG22VYSBjs.detectFeatures; exports.filterDisabled = _chunkVG22VYSBjs.filterDisabled; exports.getDefaultConfig = _chunkVG22VYSBjs.getDefaultConfig; exports.mergeFeatureFlags = _chunkVG22VYSBjs.mergeFeatureFlags; exports.parse = _chunkVG22VYSBjs.parse; exports.parseAspectRatio = _chunkVG22VYSBjs.parseAspectRatio; exports.parseRangeString = _chunkVG22VYSBjs.parseRangeString; exports.parseSlide = _chunkVG22VYSBjs.parseSlide; exports.prettify = _chunkVG22VYSBjs.prettify; exports.prettifySlide = _chunkVG22VYSBjs.prettifySlide; exports.resolveConfig = _chunkVG22VYSBjs.resolveConfig; exports.resolveFonts = _chunkVG22VYSBjs.resolveFonts; exports.scanMonacoModules = _chunkVG22VYSBjs.scanMonacoModules; exports.stringify = _chunkVG22VYSBjs.stringify; exports.stringifySlide = _chunkVG22VYSBjs.stringifySlide; exports.verifyConfig = _chunkVG22VYSBjs.verifyConfig;
|
package/dist/core.mjs
CHANGED
package/dist/fs.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkVG22VYSBjs = require('./chunk-VG22VYSB.js');
|
|
19
19
|
|
|
20
20
|
// src/fs.ts
|
|
21
21
|
var _fs = require('fs');
|
|
@@ -29,7 +29,7 @@ async function load(filepath, themeMeta, content) {
|
|
|
29
29
|
const dir = _path.dirname.call(void 0, filepath);
|
|
30
30
|
const markdown = await _asyncNullishCoalesce(content, async () => ( await _fs.promises.readFile(filepath, "utf-8")));
|
|
31
31
|
const preparserExtensions = [];
|
|
32
|
-
const data = await
|
|
32
|
+
const data = await _chunkVG22VYSBjs.parse.call(void 0, markdown, filepath, themeMeta, [], async (headmatter, exts, filepath2) => {
|
|
33
33
|
preparserExtensions.splice(
|
|
34
34
|
0,
|
|
35
35
|
preparserExtensions.length,
|
|
@@ -59,7 +59,7 @@ async function load(filepath, themeMeta, content) {
|
|
|
59
59
|
else
|
|
60
60
|
path = _path.resolve.call(void 0, dir, srcExpression);
|
|
61
61
|
const raw = await _fs.promises.readFile(path, "utf-8");
|
|
62
|
-
const subSlides = await
|
|
62
|
+
const subSlides = await _chunkVG22VYSBjs.parse.call(void 0, raw, path, themeMeta, preparserExtensions);
|
|
63
63
|
for (const [offset, subSlide] of subSlides.slides.entries()) {
|
|
64
64
|
const slide = { ...baseSlide };
|
|
65
65
|
slide.source = {
|
|
@@ -80,7 +80,7 @@ async function load(filepath, themeMeta, content) {
|
|
|
80
80
|
...baseSlideFrontMatterWithoutSrc,
|
|
81
81
|
srcSequence: `${baseSlide.frontmatter.srcSequence ? `${baseSlide.frontmatter.srcSequence},` : ""}${srcExpression}`
|
|
82
82
|
};
|
|
83
|
-
data.features =
|
|
83
|
+
data.features = _chunkVG22VYSBjs.mergeFeatureFlags.call(void 0, data.features, _chunkVG22VYSBjs.detectFeatures.call(void 0, raw));
|
|
84
84
|
entries.add(path);
|
|
85
85
|
data.slides.splice(iSlide + offset, 0, slide);
|
|
86
86
|
}
|
|
@@ -92,10 +92,10 @@ async function load(filepath, themeMeta, content) {
|
|
|
92
92
|
}
|
|
93
93
|
async function save(data, filepath) {
|
|
94
94
|
filepath = filepath || data.filepath;
|
|
95
|
-
await _fs.promises.writeFile(filepath,
|
|
95
|
+
await _fs.promises.writeFile(filepath, _chunkVG22VYSBjs.stringify.call(void 0, data), "utf-8");
|
|
96
96
|
}
|
|
97
97
|
async function saveExternalSlide(slide) {
|
|
98
|
-
await _fs.promises.writeFile(slide.filepath,
|
|
98
|
+
await _fs.promises.writeFile(slide.filepath, _chunkVG22VYSBjs.stringifySlide.call(void 0, slide), "utf-8");
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
|
|
@@ -118,4 +118,4 @@ async function saveExternalSlide(slide) {
|
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
|
|
121
|
-
exports.detectFeatures =
|
|
121
|
+
exports.detectFeatures = _chunkVG22VYSBjs.detectFeatures; exports.filterDisabled = _chunkVG22VYSBjs.filterDisabled; exports.getDefaultConfig = _chunkVG22VYSBjs.getDefaultConfig; exports.injectPreparserExtensionLoader = injectPreparserExtensionLoader; exports.load = load; exports.mergeFeatureFlags = _chunkVG22VYSBjs.mergeFeatureFlags; exports.parse = _chunkVG22VYSBjs.parse; exports.parseAspectRatio = _chunkVG22VYSBjs.parseAspectRatio; exports.parseRangeString = _chunkVG22VYSBjs.parseRangeString; exports.parseSlide = _chunkVG22VYSBjs.parseSlide; exports.prettify = _chunkVG22VYSBjs.prettify; exports.prettifySlide = _chunkVG22VYSBjs.prettifySlide; exports.resolveConfig = _chunkVG22VYSBjs.resolveConfig; exports.resolveFonts = _chunkVG22VYSBjs.resolveFonts; exports.save = save; exports.saveExternalSlide = saveExternalSlide; exports.scanMonacoModules = _chunkVG22VYSBjs.scanMonacoModules; exports.stringify = _chunkVG22VYSBjs.stringify; exports.stringifySlide = _chunkVG22VYSBjs.stringifySlide; exports.verifyConfig = _chunkVG22VYSBjs.verifyConfig;
|
package/dist/fs.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkVG22VYSBjs = require('./chunk-VG22VYSB.js');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
@@ -33,4 +33,4 @@ var _chunk2BY3EOMXjs = require('./chunk-2BY3EOMX.js');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
exports.detectFeatures =
|
|
36
|
+
exports.detectFeatures = _chunkVG22VYSBjs.detectFeatures; exports.filterDisabled = _chunkVG22VYSBjs.filterDisabled; exports.getDefaultConfig = _chunkVG22VYSBjs.getDefaultConfig; exports.mergeFeatureFlags = _chunkVG22VYSBjs.mergeFeatureFlags; exports.parse = _chunkVG22VYSBjs.parse; exports.parseAspectRatio = _chunkVG22VYSBjs.parseAspectRatio; exports.parseRangeString = _chunkVG22VYSBjs.parseRangeString; exports.parseSlide = _chunkVG22VYSBjs.parseSlide; exports.prettify = _chunkVG22VYSBjs.prettify; exports.prettifySlide = _chunkVG22VYSBjs.prettifySlide; exports.resolveConfig = _chunkVG22VYSBjs.resolveConfig; exports.resolveFonts = _chunkVG22VYSBjs.resolveFonts; exports.scanMonacoModules = _chunkVG22VYSBjs.scanMonacoModules; exports.stringify = _chunkVG22VYSBjs.stringify; exports.stringifySlide = _chunkVG22VYSBjs.stringifySlide; exports.verifyConfig = _chunkVG22VYSBjs.verifyConfig;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/parser",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.6",
|
|
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.40.
|
|
43
|
+
"@slidev/types": "0.40.6"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "rimraf dist && tsup src/index.ts src/core.ts src/fs.ts",
|