@slidev/parser 52.2.4 → 52.3.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-CY3Ayey6.mjs → core-Y81PGkhC.mjs} +4 -6
- package/dist/core.mjs +1 -1
- package/dist/fs.mjs +2 -3
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
|
@@ -33,6 +33,7 @@ function getDefaultConfig() {
|
|
|
33
33
|
drawings: {},
|
|
34
34
|
plantUmlServer: "https://www.plantuml.com/plantuml",
|
|
35
35
|
codeCopy: true,
|
|
36
|
+
magicMoveCopy: true,
|
|
36
37
|
author: "",
|
|
37
38
|
record: "dev",
|
|
38
39
|
css: "unocss",
|
|
@@ -167,10 +168,9 @@ function resolveFonts(fonts = {}) {
|
|
|
167
168
|
}
|
|
168
169
|
function resolveDrawings(options = {}, filepath) {
|
|
169
170
|
const { enabled = true, persist = false, presenterOnly = false, syncAll = true } = options;
|
|
170
|
-
const persistPath = typeof persist === "string" ? persist : persist ? `.slidev/drawings${filepath ? `/${filepath.match(/([^\\/]+?)(\.\w+)?$/)?.[1]}` : ""}` : false;
|
|
171
171
|
return {
|
|
172
172
|
enabled,
|
|
173
|
-
persist:
|
|
173
|
+
persist: typeof persist === "string" ? persist : persist ? `.slidev/drawings${filepath ? `/${filepath.match(/([^\\/]+?)(\.\w+)?$/)?.[1]}` : ""}` : false,
|
|
174
174
|
presenterOnly,
|
|
175
175
|
syncAll
|
|
176
176
|
};
|
|
@@ -268,9 +268,8 @@ async function parse(markdown, filepath, extensions, options = {}) {
|
|
|
268
268
|
let contentStart = 0;
|
|
269
269
|
async function slice(end) {
|
|
270
270
|
if (start === end) return;
|
|
271
|
-
const raw = lines.slice(start, end).join("\n");
|
|
272
271
|
const slide = {
|
|
273
|
-
...parseSlide(
|
|
272
|
+
...parseSlide(lines.slice(start, end).join("\n"), options),
|
|
274
273
|
filepath,
|
|
275
274
|
index: slides.length,
|
|
276
275
|
start,
|
|
@@ -327,9 +326,8 @@ function parseSync(markdown, filepath, options = {}) {
|
|
|
327
326
|
let contentStart = 0;
|
|
328
327
|
function slice(end) {
|
|
329
328
|
if (start === end) return;
|
|
330
|
-
const raw = lines.slice(start, end).join("\n");
|
|
331
329
|
const slide = {
|
|
332
|
-
...parseSlide(
|
|
330
|
+
...parseSlide(lines.slice(start, end).join("\n"), options),
|
|
333
331
|
filepath,
|
|
334
332
|
index: slides.length,
|
|
335
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.3.0",
|
|
4
4
|
"description": "Markdown parser for Slidev",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"node": ">=18.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@antfu/utils": "^9.
|
|
43
|
+
"@antfu/utils": "^9.3.0",
|
|
44
44
|
"yaml": "^2.8.1",
|
|
45
|
-
"@slidev/types": "52.
|
|
45
|
+
"@slidev/types": "52.3.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsdown src/index.ts src/core.ts src/fs.ts src/utils.ts",
|