@slidev/parser 52.2.5 → 52.4.0
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-j41hH_-2.mjs → core-Y81PGkhC.mjs} +3 -6
- package/dist/core.mjs +1 -1
- package/dist/fs.mjs +2 -3
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
|
@@ -168,10 +168,9 @@ function resolveFonts(fonts = {}) {
|
|
|
168
168
|
}
|
|
169
169
|
function resolveDrawings(options = {}, filepath) {
|
|
170
170
|
const { enabled = true, persist = false, presenterOnly = false, syncAll = true } = options;
|
|
171
|
-
const persistPath = typeof persist === "string" ? persist : persist ? `.slidev/drawings${filepath ? `/${filepath.match(/([^\\/]+?)(\.\w+)?$/)?.[1]}` : ""}` : false;
|
|
172
171
|
return {
|
|
173
172
|
enabled,
|
|
174
|
-
persist:
|
|
173
|
+
persist: typeof persist === "string" ? persist : persist ? `.slidev/drawings${filepath ? `/${filepath.match(/([^\\/]+?)(\.\w+)?$/)?.[1]}` : ""}` : false,
|
|
175
174
|
presenterOnly,
|
|
176
175
|
syncAll
|
|
177
176
|
};
|
|
@@ -269,9 +268,8 @@ async function parse(markdown, filepath, extensions, options = {}) {
|
|
|
269
268
|
let contentStart = 0;
|
|
270
269
|
async function slice(end) {
|
|
271
270
|
if (start === end) return;
|
|
272
|
-
const raw = lines.slice(start, end).join("\n");
|
|
273
271
|
const slide = {
|
|
274
|
-
...parseSlide(
|
|
272
|
+
...parseSlide(lines.slice(start, end).join("\n"), options),
|
|
275
273
|
filepath,
|
|
276
274
|
index: slides.length,
|
|
277
275
|
start,
|
|
@@ -328,9 +326,8 @@ function parseSync(markdown, filepath, options = {}) {
|
|
|
328
326
|
let contentStart = 0;
|
|
329
327
|
function slice(end) {
|
|
330
328
|
if (start === end) return;
|
|
331
|
-
const raw = lines.slice(start, end).join("\n");
|
|
332
329
|
const slide = {
|
|
333
|
-
...parseSlide(
|
|
330
|
+
...parseSlide(lines.slice(start, end).join("\n"), options),
|
|
334
331
|
filepath,
|
|
335
332
|
index: slides.length,
|
|
336
333
|
start,
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { parseAspectRatio, parseRangeString } from "./utils-CLLoIRbA.mjs";
|
|
2
|
-
import { detectFeatures, getDefaultConfig, parse, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig } from "./core-
|
|
2
|
+
import { detectFeatures, getDefaultConfig, parse, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig } from "./core-Y81PGkhC.mjs";
|
|
3
3
|
|
|
4
4
|
export { detectFeatures, getDefaultConfig, parse, parseAspectRatio, parseRangeString, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig };
|
package/dist/fs.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseAspectRatio, parseRangeString } from "./utils-CLLoIRbA.mjs";
|
|
2
|
-
import { detectFeatures, getDefaultConfig, parse, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig } from "./core-
|
|
2
|
+
import { detectFeatures, getDefaultConfig, parse, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig } from "./core-Y81PGkhC.mjs";
|
|
3
3
|
import { slash } from "@antfu/utils";
|
|
4
4
|
import YAML from "yaml";
|
|
5
5
|
import fs from "node:fs";
|
|
@@ -30,8 +30,7 @@ async function load(userRoot, filepath, loadedSource = {}, mode) {
|
|
|
30
30
|
async function loadMarkdown(path, range$1, frontmatterOverride, importers) {
|
|
31
31
|
let md = markdownFiles[path];
|
|
32
32
|
if (!md) {
|
|
33
|
-
|
|
34
|
-
md = await parse(raw, path, extensions);
|
|
33
|
+
md = await parse(loadedSource[path] ?? fs.readFileSync(path, "utf-8"), path, extensions);
|
|
35
34
|
markdownFiles[path] = md;
|
|
36
35
|
watchFiles[path] = /* @__PURE__ */ new Set();
|
|
37
36
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { parseAspectRatio, parseRangeString } from "./utils-CLLoIRbA.mjs";
|
|
2
|
-
import { detectFeatures, getDefaultConfig, parse, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig } from "./core-
|
|
2
|
+
import { detectFeatures, getDefaultConfig, parse, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig } from "./core-Y81PGkhC.mjs";
|
|
3
3
|
|
|
4
4
|
export { detectFeatures, getDefaultConfig, parse, parseAspectRatio, parseRangeString, parseSlide, parseSync, prettify, prettifySlide, resolveConfig, resolveFonts, stringify, stringifySlide, verifyConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/parser",
|
|
3
|
-
"version": "52.
|
|
3
|
+
"version": "52.4.0",
|
|
4
4
|
"description": "Markdown parser for Slidev",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@antfu/utils": "^9.3.0",
|
|
44
44
|
"yaml": "^2.8.1",
|
|
45
|
-
"@slidev/types": "52.
|
|
45
|
+
"@slidev/types": "52.4.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsdown src/index.ts src/core.ts src/fs.ts src/utils.ts",
|