@slidev/cli 52.11.5 → 52.13.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./resolver-B4CxEjJF.mjs";
|
|
2
|
-
import { t as resolveViteConfigs } from "./shared-
|
|
2
|
+
import { t as resolveViteConfigs } from "./shared-CPfgmHz0.mjs";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
4
|
import { build as build$1 } from "vite";
|
|
5
5
|
import { existsSync } from "node:fs";
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as resolveEntry, n as getRoots, r as isInstalledGlobally } from "./resolver-B4CxEjJF.mjs";
|
|
2
|
-
import { a as parser, c as resolveAddons, d as updateFrontmatterPatch, i as resolveOptions, l as version, o as getThemeMeta, s as resolveTheme, u as loadSetups } from "./shared-
|
|
3
|
-
import { t as createServer } from "./serve-
|
|
2
|
+
import { a as parser, c as resolveAddons, d as updateFrontmatterPatch, i as resolveOptions, l as version, o as getThemeMeta, s as resolveTheme, u as loadSetups } from "./shared-CPfgmHz0.mjs";
|
|
3
|
+
import { t as createServer } from "./serve-BhkY5tXJ.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
@@ -288,7 +288,7 @@ cli.command("build [entry..]", "Build hostable SPA", (args) => exportOptions(com
|
|
|
288
288
|
describe: "enable the inspect plugin for debugging"
|
|
289
289
|
}).strict().help(), async (args) => {
|
|
290
290
|
const { entry, theme, base, download, out, inspect, "without-notes": withoutNotes } = args;
|
|
291
|
-
const { build } = await import("./build-
|
|
291
|
+
const { build } = await import("./build-ul0zdJ3D.mjs");
|
|
292
292
|
for (const entryFile of entry) {
|
|
293
293
|
const options = await resolveOptions({
|
|
294
294
|
entry: entryFile,
|
|
@@ -353,7 +353,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
353
353
|
cli.command("export [entry..]", "Export slides to PDF", (args) => exportOptions(commonOptions(args)).strict().help(), async (args) => {
|
|
354
354
|
const { entry, theme } = args;
|
|
355
355
|
const { exportSlides, getExportOptions } = await import("./export-C4evmDwN.mjs");
|
|
356
|
-
const
|
|
356
|
+
const candidatePort = await getPort(12445);
|
|
357
357
|
let warned = false;
|
|
358
358
|
for (const entryFile of entry) {
|
|
359
359
|
const options = await resolveOptions({
|
|
@@ -365,21 +365,26 @@ cli.command("export [entry..]", "Export slides to PDF", (args) => exportOptions(
|
|
|
365
365
|
console.log(cyanBright("[Slidev] Try the new browser exporter!"));
|
|
366
366
|
console.log(cyanBright("You can use the browser exporter instead by starting the dev server as normal and visit"), `${blue("localhost:")}${dim("<port>")}${blue("/export")}\n`);
|
|
367
367
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
port
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
368
|
+
let server;
|
|
369
|
+
try {
|
|
370
|
+
server = await createServer(options, {
|
|
371
|
+
server: { port: candidatePort },
|
|
372
|
+
clearScreen: false
|
|
373
|
+
});
|
|
374
|
+
await server.listen(candidatePort);
|
|
375
|
+
const port = getViteServerPort(server);
|
|
376
|
+
printInfo(options);
|
|
377
|
+
const result = await exportSlides({
|
|
378
|
+
port,
|
|
379
|
+
...getExportOptions({
|
|
380
|
+
...args,
|
|
381
|
+
entry: entryFile
|
|
382
|
+
}, options)
|
|
383
|
+
});
|
|
384
|
+
console.log(`${green(" ✓ ")}${dim("exported to ")}${result}\n`);
|
|
385
|
+
} finally {
|
|
386
|
+
await server?.close();
|
|
387
|
+
}
|
|
383
388
|
}
|
|
384
389
|
process.exit(0);
|
|
385
390
|
});
|
|
@@ -400,27 +405,37 @@ cli.command("export-notes [entry..]", "Export slide notes to PDF", (args) => arg
|
|
|
400
405
|
describe: "wait for the specified ms before exporting"
|
|
401
406
|
}).strict().help(), async ({ entry, output, timeout, wait }) => {
|
|
402
407
|
const { exportNotes } = await import("./export-C4evmDwN.mjs");
|
|
403
|
-
const
|
|
408
|
+
const candidatePort = await getPort(12445);
|
|
404
409
|
for (const entryFile of entry) {
|
|
405
410
|
const options = await resolveOptions({ entry: entryFile }, "export");
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
port
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
411
|
+
let server;
|
|
412
|
+
try {
|
|
413
|
+
server = await createServer(options, {
|
|
414
|
+
server: { port: candidatePort },
|
|
415
|
+
clearScreen: false
|
|
416
|
+
});
|
|
417
|
+
await server.listen(candidatePort);
|
|
418
|
+
const port = getViteServerPort(server);
|
|
419
|
+
printInfo(options);
|
|
420
|
+
const result = await exportNotes({
|
|
421
|
+
port,
|
|
422
|
+
output: output || (options.data.config.exportFilename ? `${options.data.config.exportFilename}-notes` : `${path.basename(entryFile, ".md")}-export-notes`),
|
|
423
|
+
timeout,
|
|
424
|
+
wait
|
|
425
|
+
});
|
|
426
|
+
console.log(`${green(" ✓ ")}${dim("exported to ")}${result}\n`);
|
|
427
|
+
} finally {
|
|
428
|
+
await server?.close();
|
|
429
|
+
}
|
|
420
430
|
}
|
|
421
431
|
process.exit(0);
|
|
422
432
|
});
|
|
423
433
|
cli.help().parse();
|
|
434
|
+
function getViteServerPort(server) {
|
|
435
|
+
const address = server.httpServer?.address();
|
|
436
|
+
if (address && typeof address === "object") return address.port;
|
|
437
|
+
throw new Error("Failed to get Vite server port");
|
|
438
|
+
}
|
|
424
439
|
function commonOptions(args) {
|
|
425
440
|
return args.positional("entry", {
|
|
426
441
|
default: "slides.md",
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./resolver-B4CxEjJF.mjs";
|
|
2
|
-
import { a as parser, i as resolveOptions, n as ViteSlidevPlugin, r as createDataUtils } from "./shared-
|
|
3
|
-
import { t as createServer } from "./serve-
|
|
2
|
+
import { a as parser, i as resolveOptions, n as ViteSlidevPlugin, r as createDataUtils } from "./shared-CPfgmHz0.mjs";
|
|
3
|
+
import { t as createServer } from "./serve-BhkY5tXJ.mjs";
|
|
4
4
|
|
|
5
5
|
export { ViteSlidevPlugin, createDataUtils, createServer, parser, resolveOptions };
|
|
@@ -2,7 +2,7 @@ import { a as resolveImportPath, c as toAtFS, i as resolveEntry, n as getRoots,
|
|
|
2
2
|
import { builtinModules } from "node:module";
|
|
3
3
|
import path, { basename, dirname, join, relative, resolve } from "node:path";
|
|
4
4
|
import { loadConfigFromFile, mergeConfig } from "vite";
|
|
5
|
-
import
|
|
5
|
+
import MarkdownExit from "markdown-exit";
|
|
6
6
|
import fs, { existsSync } from "node:fs";
|
|
7
7
|
import fs$1, { readFile } from "node:fs/promises";
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -21,7 +21,6 @@ import fg from "fast-glob";
|
|
|
21
21
|
import { createDebug } from "obug";
|
|
22
22
|
import pm from "picomatch";
|
|
23
23
|
import { satisfies } from "semver";
|
|
24
|
-
import { escapeHtml } from "markdown-it/lib/common/utils.mjs";
|
|
25
24
|
import { createHead, extractUnheadInputFromHtml, transformHtmlTemplate } from "unhead/server";
|
|
26
25
|
import { createSingletonShorthands, createdBundledHighlighter } from "shiki/core";
|
|
27
26
|
import { createJavaScriptRegexEngine } from "shiki/engine/javascript";
|
|
@@ -29,7 +28,6 @@ import { bundledLanguages, bundledThemes } from "shiki";
|
|
|
29
28
|
import katex from "katex";
|
|
30
29
|
import MagicString from "magic-string-stack";
|
|
31
30
|
import Markdown from "unplugin-vue-markdown/vite";
|
|
32
|
-
import Token from "markdown-it/lib/token.mjs";
|
|
33
31
|
import MarkdownItFootnote from "markdown-it-footnote";
|
|
34
32
|
import MarkdownItMdc from "markdown-it-mdc";
|
|
35
33
|
import { fromAsyncCodeToHtml } from "@shikijs/markdown-it/async";
|
|
@@ -505,7 +503,7 @@ function createLayoutWrapperPlugin({ data, utils }) {
|
|
|
505
503
|
|
|
506
504
|
//#endregion
|
|
507
505
|
//#region package.json
|
|
508
|
-
var version = "52.
|
|
506
|
+
var version = "52.13.0";
|
|
509
507
|
|
|
510
508
|
//#endregion
|
|
511
509
|
//#region node/integrations/addons.ts
|
|
@@ -547,9 +545,33 @@ async function getThemeMeta(name, root) {
|
|
|
547
545
|
|
|
548
546
|
//#endregion
|
|
549
547
|
//#region node/setups/indexHtml.ts
|
|
548
|
+
function escapeHtml(str) {
|
|
549
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
550
|
+
}
|
|
550
551
|
function toAttrValue(unsafe) {
|
|
551
552
|
return JSON.stringify(escapeHtml(String(unsafe)));
|
|
552
553
|
}
|
|
554
|
+
function collectPreloadImages(data, base) {
|
|
555
|
+
if (data.config.preloadImages === false) return [];
|
|
556
|
+
const seen = /* @__PURE__ */ new Set();
|
|
557
|
+
const links = [];
|
|
558
|
+
const basePrefix = base ? base.replace(/\/$/, "") : "";
|
|
559
|
+
for (const slide of data.slides) {
|
|
560
|
+
const images = slide.images || slide.source?.images;
|
|
561
|
+
if (!images?.length) continue;
|
|
562
|
+
for (const url of images) {
|
|
563
|
+
if (seen.has(url)) continue;
|
|
564
|
+
seen.add(url);
|
|
565
|
+
const href = url.startsWith("http") || url.startsWith("//") ? url : `${basePrefix}${url.startsWith("/") ? url : `/${url}`}`;
|
|
566
|
+
links.push({
|
|
567
|
+
rel: "preload",
|
|
568
|
+
as: "image",
|
|
569
|
+
href
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return links;
|
|
574
|
+
}
|
|
553
575
|
async function setupIndexHtml({ mode, entry, clientRoot, userRoot, roots, data, base }) {
|
|
554
576
|
let main = await readFile(join(clientRoot, "index.html"), "utf-8");
|
|
555
577
|
let body = "";
|
|
@@ -589,10 +611,14 @@ async function setupIndexHtml({ mode, entry, clientRoot, userRoot, roots, data,
|
|
|
589
611
|
const unhead = createHead({ init: [{
|
|
590
612
|
htmlAttrs: data.headmatter.lang ? { lang: data.headmatter.lang } : void 0,
|
|
591
613
|
title,
|
|
592
|
-
link: [
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
614
|
+
link: [
|
|
615
|
+
data.config.favicon ? {
|
|
616
|
+
rel: "icon",
|
|
617
|
+
href: data.config.favicon
|
|
618
|
+
} : null,
|
|
619
|
+
...webFontsLink,
|
|
620
|
+
...collectPreloadImages(data, base)
|
|
621
|
+
].filter((x) => x),
|
|
596
622
|
meta: [
|
|
597
623
|
{
|
|
598
624
|
"http-equiv": "Content-Type",
|
|
@@ -1301,12 +1327,12 @@ const templateStyle = {
|
|
|
1301
1327
|
return toAtFS(join(clientRoot, name));
|
|
1302
1328
|
}
|
|
1303
1329
|
const imports = [
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
];
|
|
1330
|
+
"styles/vars.css",
|
|
1331
|
+
"styles/index.css",
|
|
1332
|
+
"styles/code.css",
|
|
1333
|
+
"styles/katex.css",
|
|
1334
|
+
"styles/transitions.css"
|
|
1335
|
+
].map((path$1) => makeAbsoluteImportGlob(userRoot, [join(clientRoot, path$1)]));
|
|
1310
1336
|
for (const root of roots) imports.push(makeAbsoluteImportGlob(userRoot, [
|
|
1311
1337
|
join(root, "styles/index.{ts,js,css}"),
|
|
1312
1338
|
join(root, "styles.{ts,js,css}"),
|
|
@@ -1359,7 +1385,7 @@ const templates = [
|
|
|
1359
1385
|
//#region node/vite/loaders.ts
|
|
1360
1386
|
function createSlidesLoader(options, serverOptions) {
|
|
1361
1387
|
const { data, mode, utils, withoutNotes } = options;
|
|
1362
|
-
const notesMd =
|
|
1388
|
+
const notesMd = MarkdownExit({ html: true });
|
|
1363
1389
|
notesMd.use(MarkdownItLink);
|
|
1364
1390
|
if (data.features.katex) notesMd.use(MarkdownItKatex, utils.katexOptions);
|
|
1365
1391
|
const hmrSlidesIndexes = /* @__PURE__ */ new Set();
|
|
@@ -1632,6 +1658,162 @@ var SpecialCharacters;
|
|
|
1632
1658
|
SpecialCharacters$1[SpecialCharacters$1["CLOSING_PARENTHESIS"] = 41] = "CLOSING_PARENTHESIS";
|
|
1633
1659
|
})(SpecialCharacters || (SpecialCharacters = {}));
|
|
1634
1660
|
|
|
1661
|
+
//#endregion
|
|
1662
|
+
//#region ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/token.mjs
|
|
1663
|
+
/**
|
|
1664
|
+
* class Token
|
|
1665
|
+
**/
|
|
1666
|
+
/**
|
|
1667
|
+
* new Token(type, tag, nesting)
|
|
1668
|
+
*
|
|
1669
|
+
* Create new token and fill passed properties.
|
|
1670
|
+
**/
|
|
1671
|
+
function Token(type, tag, nesting) {
|
|
1672
|
+
/**
|
|
1673
|
+
* Token#type -> String
|
|
1674
|
+
*
|
|
1675
|
+
* Type of the token (string, e.g. "paragraph_open")
|
|
1676
|
+
**/
|
|
1677
|
+
this.type = type;
|
|
1678
|
+
/**
|
|
1679
|
+
* Token#tag -> String
|
|
1680
|
+
*
|
|
1681
|
+
* html tag name, e.g. "p"
|
|
1682
|
+
**/
|
|
1683
|
+
this.tag = tag;
|
|
1684
|
+
/**
|
|
1685
|
+
* Token#attrs -> Array
|
|
1686
|
+
*
|
|
1687
|
+
* Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
|
|
1688
|
+
**/
|
|
1689
|
+
this.attrs = null;
|
|
1690
|
+
/**
|
|
1691
|
+
* Token#map -> Array
|
|
1692
|
+
*
|
|
1693
|
+
* Source map info. Format: `[ line_begin, line_end ]`
|
|
1694
|
+
**/
|
|
1695
|
+
this.map = null;
|
|
1696
|
+
/**
|
|
1697
|
+
* Token#nesting -> Number
|
|
1698
|
+
*
|
|
1699
|
+
* Level change (number in {-1, 0, 1} set), where:
|
|
1700
|
+
*
|
|
1701
|
+
* - `1` means the tag is opening
|
|
1702
|
+
* - `0` means the tag is self-closing
|
|
1703
|
+
* - `-1` means the tag is closing
|
|
1704
|
+
**/
|
|
1705
|
+
this.nesting = nesting;
|
|
1706
|
+
/**
|
|
1707
|
+
* Token#level -> Number
|
|
1708
|
+
*
|
|
1709
|
+
* nesting level, the same as `state.level`
|
|
1710
|
+
**/
|
|
1711
|
+
this.level = 0;
|
|
1712
|
+
/**
|
|
1713
|
+
* Token#children -> Array
|
|
1714
|
+
*
|
|
1715
|
+
* An array of child nodes (inline and img tokens)
|
|
1716
|
+
**/
|
|
1717
|
+
this.children = null;
|
|
1718
|
+
/**
|
|
1719
|
+
* Token#content -> String
|
|
1720
|
+
*
|
|
1721
|
+
* In a case of self-closing tag (code, html, fence, etc.),
|
|
1722
|
+
* it has contents of this tag.
|
|
1723
|
+
**/
|
|
1724
|
+
this.content = "";
|
|
1725
|
+
/**
|
|
1726
|
+
* Token#markup -> String
|
|
1727
|
+
*
|
|
1728
|
+
* '*' or '_' for emphasis, fence string for fence, etc.
|
|
1729
|
+
**/
|
|
1730
|
+
this.markup = "";
|
|
1731
|
+
/**
|
|
1732
|
+
* Token#info -> String
|
|
1733
|
+
*
|
|
1734
|
+
* Additional information:
|
|
1735
|
+
*
|
|
1736
|
+
* - Info string for "fence" tokens
|
|
1737
|
+
* - The value "auto" for autolink "link_open" and "link_close" tokens
|
|
1738
|
+
* - The string value of the item marker for ordered-list "list_item_open" tokens
|
|
1739
|
+
**/
|
|
1740
|
+
this.info = "";
|
|
1741
|
+
/**
|
|
1742
|
+
* Token#meta -> Object
|
|
1743
|
+
*
|
|
1744
|
+
* A place for plugins to store an arbitrary data
|
|
1745
|
+
**/
|
|
1746
|
+
this.meta = null;
|
|
1747
|
+
/**
|
|
1748
|
+
* Token#block -> Boolean
|
|
1749
|
+
*
|
|
1750
|
+
* True for block-level tokens, false for inline tokens.
|
|
1751
|
+
* Used in renderer to calculate line breaks
|
|
1752
|
+
**/
|
|
1753
|
+
this.block = false;
|
|
1754
|
+
/**
|
|
1755
|
+
* Token#hidden -> Boolean
|
|
1756
|
+
*
|
|
1757
|
+
* If it's true, ignore this element when rendering. Used for tight lists
|
|
1758
|
+
* to hide paragraphs.
|
|
1759
|
+
**/
|
|
1760
|
+
this.hidden = false;
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* Token.attrIndex(name) -> Number
|
|
1764
|
+
*
|
|
1765
|
+
* Search attribute index by name.
|
|
1766
|
+
**/
|
|
1767
|
+
Token.prototype.attrIndex = function attrIndex(name) {
|
|
1768
|
+
if (!this.attrs) return -1;
|
|
1769
|
+
const attrs = this.attrs;
|
|
1770
|
+
for (let i = 0, len = attrs.length; i < len; i++) if (attrs[i][0] === name) return i;
|
|
1771
|
+
return -1;
|
|
1772
|
+
};
|
|
1773
|
+
/**
|
|
1774
|
+
* Token.attrPush(attrData)
|
|
1775
|
+
*
|
|
1776
|
+
* Add `[ name, value ]` attribute to list. Init attrs if necessary
|
|
1777
|
+
**/
|
|
1778
|
+
Token.prototype.attrPush = function attrPush(attrData) {
|
|
1779
|
+
if (this.attrs) this.attrs.push(attrData);
|
|
1780
|
+
else this.attrs = [attrData];
|
|
1781
|
+
};
|
|
1782
|
+
/**
|
|
1783
|
+
* Token.attrSet(name, value)
|
|
1784
|
+
*
|
|
1785
|
+
* Set `name` attribute to `value`. Override old value if exists.
|
|
1786
|
+
**/
|
|
1787
|
+
Token.prototype.attrSet = function attrSet(name, value) {
|
|
1788
|
+
const idx = this.attrIndex(name);
|
|
1789
|
+
const attrData = [name, value];
|
|
1790
|
+
if (idx < 0) this.attrPush(attrData);
|
|
1791
|
+
else this.attrs[idx] = attrData;
|
|
1792
|
+
};
|
|
1793
|
+
/**
|
|
1794
|
+
* Token.attrGet(name)
|
|
1795
|
+
*
|
|
1796
|
+
* Get the value of attribute `name`, or null if it does not exist.
|
|
1797
|
+
**/
|
|
1798
|
+
Token.prototype.attrGet = function attrGet(name) {
|
|
1799
|
+
const idx = this.attrIndex(name);
|
|
1800
|
+
let value = null;
|
|
1801
|
+
if (idx >= 0) value = this.attrs[idx][1];
|
|
1802
|
+
return value;
|
|
1803
|
+
};
|
|
1804
|
+
/**
|
|
1805
|
+
* Token.attrJoin(name, value)
|
|
1806
|
+
*
|
|
1807
|
+
* Join value to existing attribute via space. Or create new attribute if not
|
|
1808
|
+
* exists. Useful to operate with token classes.
|
|
1809
|
+
**/
|
|
1810
|
+
Token.prototype.attrJoin = function attrJoin(name, value) {
|
|
1811
|
+
const idx = this.attrIndex(name);
|
|
1812
|
+
if (idx < 0) this.attrPush([name, value]);
|
|
1813
|
+
else this.attrs[idx][1] = this.attrs[idx][1] + " " + value;
|
|
1814
|
+
};
|
|
1815
|
+
var token_default = Token;
|
|
1816
|
+
|
|
1635
1817
|
//#endregion
|
|
1636
1818
|
//#region ../../node_modules/.pnpm/@hedgedoc+markdown-it-plugins@2.1.4_patch_hash=49e14003b6caa0b7d164cbe71da573809d375bab_d6f3113a192503d8f8553bee4b7feffb/node_modules/@hedgedoc/markdown-it-plugins/dist/esm/task-lists/index.js
|
|
1637
1819
|
const checkboxRegex = /^ *\[([\sx])] /i;
|
|
@@ -1691,7 +1873,7 @@ function generateIdForToken(token) {
|
|
|
1691
1873
|
else return `task-item-${Math.ceil(Math.random() * (1e4 * 1e3) - 1e3)}`;
|
|
1692
1874
|
}
|
|
1693
1875
|
function createCheckboxToken(token, enabled, id) {
|
|
1694
|
-
const checkbox = new
|
|
1876
|
+
const checkbox = new token_default("taskListItemCheckbox", "", 0);
|
|
1695
1877
|
if (!enabled) checkbox.attrSet("disabled", "true");
|
|
1696
1878
|
if (token.map) checkbox.attrSet("line", token.map[0].toString());
|
|
1697
1879
|
checkbox.attrSet("id", id);
|
|
@@ -1699,12 +1881,12 @@ function createCheckboxToken(token, enabled, id) {
|
|
|
1699
1881
|
return checkbox;
|
|
1700
1882
|
}
|
|
1701
1883
|
function createLabelBeginToken(id) {
|
|
1702
|
-
const labelBeginToken = new
|
|
1884
|
+
const labelBeginToken = new token_default("taskListItemLabel_open", "", 1);
|
|
1703
1885
|
labelBeginToken.attrSet("id", id);
|
|
1704
1886
|
return labelBeginToken;
|
|
1705
1887
|
}
|
|
1706
1888
|
function createLabelEndToken() {
|
|
1707
|
-
return new
|
|
1889
|
+
return new token_default("taskListItemLabel_close", "", -1);
|
|
1708
1890
|
}
|
|
1709
1891
|
function isInline(token) {
|
|
1710
1892
|
return token.type === "inline";
|
|
@@ -1723,8 +1905,8 @@ function startsWithTodoMarkdown(token) {
|
|
|
1723
1905
|
//#region node/syntax/markdown-it/markdown-it-escape-code.ts
|
|
1724
1906
|
function MarkdownItEscapeInlineCode(md) {
|
|
1725
1907
|
const codeInline = md.renderer.rules.code_inline;
|
|
1726
|
-
md.renderer.rules.code_inline = (tokens, idx, options, env, self) => {
|
|
1727
|
-
return codeInline(tokens, idx, options, env, self).replace(/^<code/, "<code v-pre");
|
|
1908
|
+
md.renderer.rules.code_inline = async (tokens, idx, options, env, self) => {
|
|
1909
|
+
return (await codeInline(tokens, idx, options, env, self)).replace(/^<code/, "<code v-pre");
|
|
1728
1910
|
};
|
|
1729
1911
|
}
|
|
1730
1912
|
|
|
@@ -2214,17 +2396,17 @@ async function createMarkdownPlugin(options, { markdown: mdOptions }) {
|
|
|
2214
2396
|
headEnabled: false,
|
|
2215
2397
|
frontmatter: false,
|
|
2216
2398
|
escapeCodeTagInterpolation: false,
|
|
2217
|
-
|
|
2399
|
+
markdownOptions: {
|
|
2218
2400
|
quotes: "\"\"''",
|
|
2219
2401
|
html: true,
|
|
2220
2402
|
xhtmlOut: true,
|
|
2221
2403
|
linkify: true,
|
|
2222
|
-
...mdOptions?.
|
|
2404
|
+
...mdOptions?.markdownOptions
|
|
2223
2405
|
},
|
|
2224
2406
|
...mdOptions,
|
|
2225
|
-
async
|
|
2407
|
+
async markdownSetup(md) {
|
|
2226
2408
|
await useMarkdownItPlugins(md, options, markdownTransformMap);
|
|
2227
|
-
await mdOptions?.
|
|
2409
|
+
await mdOptions?.markdownSetup?.(md);
|
|
2228
2410
|
},
|
|
2229
2411
|
transforms: {
|
|
2230
2412
|
...mdOptions?.transforms,
|
|
@@ -2564,7 +2746,7 @@ function ViteSlidevPlugin(options, pluginOptions = {}, serverOptions = {}) {
|
|
|
2564
2746
|
|
|
2565
2747
|
//#endregion
|
|
2566
2748
|
//#region node/commands/shared.ts
|
|
2567
|
-
const sharedMd =
|
|
2749
|
+
const sharedMd = MarkdownExit({ html: true });
|
|
2568
2750
|
sharedMd.use(MarkdownItLink);
|
|
2569
2751
|
function getSlideTitle(data) {
|
|
2570
2752
|
const title = stringifyMarkdownTokens(sharedMd.parseInline(data.config.title, {}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "52.
|
|
4
|
+
"version": "52.13.0",
|
|
5
5
|
"description": "Presentation slides for developers",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"lz-string": "^1.5.0",
|
|
73
73
|
"magic-string": "^0.30.21",
|
|
74
74
|
"magic-string-stack": "^1.1.0",
|
|
75
|
-
"markdown-
|
|
75
|
+
"markdown-exit": "^1.0.0-beta.8",
|
|
76
76
|
"markdown-it-footnote": "^4.0.0",
|
|
77
77
|
"markdown-it-mdc": "^0.2.8",
|
|
78
78
|
"mlly": "^1.8.0",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"unocss": "^66.6.0",
|
|
99
99
|
"unplugin-icons": "^23.0.1",
|
|
100
100
|
"unplugin-vue-components": "^31.0.0",
|
|
101
|
-
"unplugin-vue-markdown": "^
|
|
101
|
+
"unplugin-vue-markdown": "^30.0.0",
|
|
102
102
|
"untun": "^0.1.3",
|
|
103
103
|
"uqr": "^0.1.2",
|
|
104
104
|
"vite": "^7.3.1",
|
|
@@ -110,9 +110,9 @@
|
|
|
110
110
|
"vue": "^3.5.27",
|
|
111
111
|
"yaml": "^2.8.2",
|
|
112
112
|
"yargs": "^18.0.0",
|
|
113
|
-
"@slidev/client": "52.
|
|
114
|
-
"@slidev/types": "52.
|
|
115
|
-
"@slidev/parser": "52.
|
|
113
|
+
"@slidev/client": "52.13.0",
|
|
114
|
+
"@slidev/types": "52.13.0",
|
|
115
|
+
"@slidev/parser": "52.13.0"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
118
|
"@hedgedoc/markdown-it-plugins": "^2.1.4",
|