@slidev/parser 0.38.3 → 0.38.5

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.
@@ -157,7 +157,7 @@ function parseAspectRatio(str) {
157
157
 
158
158
  // src/config.ts
159
159
  function resolveConfig(headmatter, themeMeta = {}, filepath, verify = false) {
160
- var _a, _b;
160
+ var _a, _b, _c, _d;
161
161
  const themeHightlighter = ["prism", "shiki"].includes(themeMeta.highlighter || "") ? themeMeta.highlighter : void 0;
162
162
  const themeColorSchema = ["light", "dark"].includes(themeMeta.colorSchema || "") ? themeMeta.colorSchema : void 0;
163
163
  const defaultConfig = {
@@ -184,7 +184,9 @@ function resolveConfig(headmatter, themeMeta = {}, filepath, verify = false) {
184
184
  plantUmlServer: "https://www.plantuml.com/plantuml",
185
185
  codeCopy: true,
186
186
  record: "dev",
187
- css: "windicss"
187
+ css: "windicss",
188
+ presenter: true,
189
+ htmlAttrs: {}
188
190
  };
189
191
  const config = {
190
192
  ...defaultConfig,
@@ -196,7 +198,12 @@ function resolveConfig(headmatter, themeMeta = {}, filepath, verify = false) {
196
198
  ...(_b = headmatter.config) == null ? void 0 : _b.fonts,
197
199
  ...headmatter == null ? void 0 : headmatter.fonts
198
200
  }),
199
- drawings: resolveDrawings(headmatter.drawings, filepath)
201
+ drawings: resolveDrawings(headmatter.drawings, filepath),
202
+ htmlAttrs: {
203
+ ...(_c = themeMeta.defaults) == null ? void 0 : _c.htmlAttrs,
204
+ ...(_d = headmatter.config) == null ? void 0 : _d.htmlAttrs,
205
+ ...headmatter == null ? void 0 : headmatter.htmlAttrs
206
+ }
200
207
  };
201
208
  if (config.colorSchema !== "dark" && config.colorSchema !== "light")
202
209
  config.colorSchema = "auto";
@@ -157,7 +157,7 @@ function parseAspectRatio(str) {
157
157
 
158
158
  // src/config.ts
159
159
  function resolveConfig(headmatter, themeMeta = {}, filepath, verify = false) {
160
- var _a, _b;
160
+ var _a, _b, _c, _d;
161
161
  const themeHightlighter = ["prism", "shiki"].includes(themeMeta.highlighter || "") ? themeMeta.highlighter : void 0;
162
162
  const themeColorSchema = ["light", "dark"].includes(themeMeta.colorSchema || "") ? themeMeta.colorSchema : void 0;
163
163
  const defaultConfig = {
@@ -184,7 +184,9 @@ function resolveConfig(headmatter, themeMeta = {}, filepath, verify = false) {
184
184
  plantUmlServer: "https://www.plantuml.com/plantuml",
185
185
  codeCopy: true,
186
186
  record: "dev",
187
- css: "windicss"
187
+ css: "windicss",
188
+ presenter: true,
189
+ htmlAttrs: {}
188
190
  };
189
191
  const config = {
190
192
  ...defaultConfig,
@@ -196,7 +198,12 @@ function resolveConfig(headmatter, themeMeta = {}, filepath, verify = false) {
196
198
  ...(_b = headmatter.config) == null ? void 0 : _b.fonts,
197
199
  ...headmatter == null ? void 0 : headmatter.fonts
198
200
  }),
199
- drawings: resolveDrawings(headmatter.drawings, filepath)
201
+ drawings: resolveDrawings(headmatter.drawings, filepath),
202
+ htmlAttrs: {
203
+ ...(_c = themeMeta.defaults) == null ? void 0 : _c.htmlAttrs,
204
+ ...(_d = headmatter.config) == null ? void 0 : _d.htmlAttrs,
205
+ ...headmatter == null ? void 0 : headmatter.htmlAttrs
206
+ }
200
207
  };
201
208
  if (config.colorSchema !== "dark" && config.colorSchema !== "light")
202
209
  config.colorSchema = "auto";
package/dist/core.js CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkC3OTKWGWjs = require('./chunk-C3OTKWGW.js');
17
+ var _chunk5SMNV4NLjs = require('./chunk-5SMNV4NL.js');
18
18
 
19
19
 
20
20
 
@@ -31,4 +31,4 @@ var _chunkC3OTKWGWjs = require('./chunk-C3OTKWGW.js');
31
31
 
32
32
 
33
33
 
34
- exports.detectFeatures = _chunkC3OTKWGWjs.detectFeatures; exports.filterDisabled = _chunkC3OTKWGWjs.filterDisabled; exports.mergeFeatureFlags = _chunkC3OTKWGWjs.mergeFeatureFlags; exports.parse = _chunkC3OTKWGWjs.parse; exports.parseAspectRatio = _chunkC3OTKWGWjs.parseAspectRatio; exports.parseRangeString = _chunkC3OTKWGWjs.parseRangeString; exports.parseSlide = _chunkC3OTKWGWjs.parseSlide; exports.prettify = _chunkC3OTKWGWjs.prettify; exports.prettifySlide = _chunkC3OTKWGWjs.prettifySlide; exports.resolveConfig = _chunkC3OTKWGWjs.resolveConfig; exports.resolveFonts = _chunkC3OTKWGWjs.resolveFonts; exports.scanMonacoModules = _chunkC3OTKWGWjs.scanMonacoModules; exports.stringify = _chunkC3OTKWGWjs.stringify; exports.stringifySlide = _chunkC3OTKWGWjs.stringifySlide; exports.verifyConfig = _chunkC3OTKWGWjs.verifyConfig;
34
+ exports.detectFeatures = _chunk5SMNV4NLjs.detectFeatures; exports.filterDisabled = _chunk5SMNV4NLjs.filterDisabled; exports.mergeFeatureFlags = _chunk5SMNV4NLjs.mergeFeatureFlags; exports.parse = _chunk5SMNV4NLjs.parse; exports.parseAspectRatio = _chunk5SMNV4NLjs.parseAspectRatio; exports.parseRangeString = _chunk5SMNV4NLjs.parseRangeString; exports.parseSlide = _chunk5SMNV4NLjs.parseSlide; exports.prettify = _chunk5SMNV4NLjs.prettify; exports.prettifySlide = _chunk5SMNV4NLjs.prettifySlide; exports.resolveConfig = _chunk5SMNV4NLjs.resolveConfig; exports.resolveFonts = _chunk5SMNV4NLjs.resolveFonts; exports.scanMonacoModules = _chunk5SMNV4NLjs.scanMonacoModules; exports.stringify = _chunk5SMNV4NLjs.stringify; exports.stringifySlide = _chunk5SMNV4NLjs.stringifySlide; exports.verifyConfig = _chunk5SMNV4NLjs.verifyConfig;
package/dist/core.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  stringify,
15
15
  stringifySlide,
16
16
  verifyConfig
17
- } from "./chunk-RQLJEQ6S.mjs";
17
+ } from "./chunk-ZHXGSN7W.mjs";
18
18
  export {
19
19
  detectFeatures,
20
20
  filterDisabled,
package/dist/fs.js CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkC3OTKWGWjs = require('./chunk-C3OTKWGW.js');
17
+ var _chunk5SMNV4NLjs = require('./chunk-5SMNV4NL.js');
18
18
 
19
19
  // src/fs.ts
20
20
  var _fs = require('fs');
@@ -28,7 +28,7 @@ async function load(filepath, themeMeta, content) {
28
28
  const dir = _path.dirname.call(void 0, filepath);
29
29
  const markdown = content != null ? content : await _fs.promises.readFile(filepath, "utf-8");
30
30
  const preparserExtensions = [];
31
- const data = await _chunkC3OTKWGWjs.parse.call(void 0, markdown, filepath, themeMeta, [], async (headmatter, exts, filepath2) => {
31
+ const data = await _chunk5SMNV4NLjs.parse.call(void 0, markdown, filepath, themeMeta, [], async (headmatter, exts, filepath2) => {
32
32
  preparserExtensions.splice(
33
33
  0,
34
34
  preparserExtensions.length,
@@ -58,7 +58,7 @@ async function load(filepath, themeMeta, content) {
58
58
  else
59
59
  path = _path.resolve.call(void 0, dir, srcExpression);
60
60
  const raw = await _fs.promises.readFile(path, "utf-8");
61
- const subSlides = await _chunkC3OTKWGWjs.parse.call(void 0, raw, path, themeMeta, preparserExtensions);
61
+ const subSlides = await _chunk5SMNV4NLjs.parse.call(void 0, raw, path, themeMeta, preparserExtensions);
62
62
  for (const [offset, subSlide] of subSlides.slides.entries()) {
63
63
  const slide = { ...baseSlide };
64
64
  slide.source = {
@@ -79,7 +79,7 @@ async function load(filepath, themeMeta, content) {
79
79
  ...baseSlideFrontMatterWithoutSrc,
80
80
  srcSequence: `${baseSlide.frontmatter.srcSequence ? `${baseSlide.frontmatter.srcSequence},` : ""}${srcExpression}`
81
81
  };
82
- data.features = _chunkC3OTKWGWjs.mergeFeatureFlags.call(void 0, data.features, _chunkC3OTKWGWjs.detectFeatures.call(void 0, raw));
82
+ data.features = _chunk5SMNV4NLjs.mergeFeatureFlags.call(void 0, data.features, _chunk5SMNV4NLjs.detectFeatures.call(void 0, raw));
83
83
  entries.add(path);
84
84
  data.slides.splice(iSlide + offset, 0, slide);
85
85
  }
@@ -91,10 +91,10 @@ async function load(filepath, themeMeta, content) {
91
91
  }
92
92
  async function save(data, filepath) {
93
93
  filepath = filepath || data.filepath;
94
- await _fs.promises.writeFile(filepath, _chunkC3OTKWGWjs.stringify.call(void 0, data), "utf-8");
94
+ await _fs.promises.writeFile(filepath, _chunk5SMNV4NLjs.stringify.call(void 0, data), "utf-8");
95
95
  }
96
96
  async function saveExternalSlide(slide) {
97
- await _fs.promises.writeFile(slide.filepath, _chunkC3OTKWGWjs.stringifySlide.call(void 0, slide), "utf-8");
97
+ await _fs.promises.writeFile(slide.filepath, _chunk5SMNV4NLjs.stringifySlide.call(void 0, slide), "utf-8");
98
98
  }
99
99
 
100
100
 
@@ -116,4 +116,4 @@ async function saveExternalSlide(slide) {
116
116
 
117
117
 
118
118
 
119
- exports.detectFeatures = _chunkC3OTKWGWjs.detectFeatures; exports.filterDisabled = _chunkC3OTKWGWjs.filterDisabled; exports.injectPreparserExtensionLoader = injectPreparserExtensionLoader; exports.load = load; exports.mergeFeatureFlags = _chunkC3OTKWGWjs.mergeFeatureFlags; exports.parse = _chunkC3OTKWGWjs.parse; exports.parseAspectRatio = _chunkC3OTKWGWjs.parseAspectRatio; exports.parseRangeString = _chunkC3OTKWGWjs.parseRangeString; exports.parseSlide = _chunkC3OTKWGWjs.parseSlide; exports.prettify = _chunkC3OTKWGWjs.prettify; exports.prettifySlide = _chunkC3OTKWGWjs.prettifySlide; exports.resolveConfig = _chunkC3OTKWGWjs.resolveConfig; exports.resolveFonts = _chunkC3OTKWGWjs.resolveFonts; exports.save = save; exports.saveExternalSlide = saveExternalSlide; exports.scanMonacoModules = _chunkC3OTKWGWjs.scanMonacoModules; exports.stringify = _chunkC3OTKWGWjs.stringify; exports.stringifySlide = _chunkC3OTKWGWjs.stringifySlide; exports.verifyConfig = _chunkC3OTKWGWjs.verifyConfig;
119
+ exports.detectFeatures = _chunk5SMNV4NLjs.detectFeatures; exports.filterDisabled = _chunk5SMNV4NLjs.filterDisabled; exports.injectPreparserExtensionLoader = injectPreparserExtensionLoader; exports.load = load; exports.mergeFeatureFlags = _chunk5SMNV4NLjs.mergeFeatureFlags; exports.parse = _chunk5SMNV4NLjs.parse; exports.parseAspectRatio = _chunk5SMNV4NLjs.parseAspectRatio; exports.parseRangeString = _chunk5SMNV4NLjs.parseRangeString; exports.parseSlide = _chunk5SMNV4NLjs.parseSlide; exports.prettify = _chunk5SMNV4NLjs.prettify; exports.prettifySlide = _chunk5SMNV4NLjs.prettifySlide; exports.resolveConfig = _chunk5SMNV4NLjs.resolveConfig; exports.resolveFonts = _chunk5SMNV4NLjs.resolveFonts; exports.save = save; exports.saveExternalSlide = saveExternalSlide; exports.scanMonacoModules = _chunk5SMNV4NLjs.scanMonacoModules; exports.stringify = _chunk5SMNV4NLjs.stringify; exports.stringifySlide = _chunk5SMNV4NLjs.stringifySlide; exports.verifyConfig = _chunk5SMNV4NLjs.verifyConfig;
package/dist/fs.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  stringify,
15
15
  stringifySlide,
16
16
  verifyConfig
17
- } from "./chunk-RQLJEQ6S.mjs";
17
+ } from "./chunk-ZHXGSN7W.mjs";
18
18
 
19
19
  // src/fs.ts
20
20
  import { promises as fs } from "fs";
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunkC3OTKWGWjs = require('./chunk-C3OTKWGW.js');
17
+ var _chunk5SMNV4NLjs = require('./chunk-5SMNV4NL.js');
18
18
 
19
19
 
20
20
 
@@ -31,4 +31,4 @@ var _chunkC3OTKWGWjs = require('./chunk-C3OTKWGW.js');
31
31
 
32
32
 
33
33
 
34
- exports.detectFeatures = _chunkC3OTKWGWjs.detectFeatures; exports.filterDisabled = _chunkC3OTKWGWjs.filterDisabled; exports.mergeFeatureFlags = _chunkC3OTKWGWjs.mergeFeatureFlags; exports.parse = _chunkC3OTKWGWjs.parse; exports.parseAspectRatio = _chunkC3OTKWGWjs.parseAspectRatio; exports.parseRangeString = _chunkC3OTKWGWjs.parseRangeString; exports.parseSlide = _chunkC3OTKWGWjs.parseSlide; exports.prettify = _chunkC3OTKWGWjs.prettify; exports.prettifySlide = _chunkC3OTKWGWjs.prettifySlide; exports.resolveConfig = _chunkC3OTKWGWjs.resolveConfig; exports.resolveFonts = _chunkC3OTKWGWjs.resolveFonts; exports.scanMonacoModules = _chunkC3OTKWGWjs.scanMonacoModules; exports.stringify = _chunkC3OTKWGWjs.stringify; exports.stringifySlide = _chunkC3OTKWGWjs.stringifySlide; exports.verifyConfig = _chunkC3OTKWGWjs.verifyConfig;
34
+ exports.detectFeatures = _chunk5SMNV4NLjs.detectFeatures; exports.filterDisabled = _chunk5SMNV4NLjs.filterDisabled; exports.mergeFeatureFlags = _chunk5SMNV4NLjs.mergeFeatureFlags; exports.parse = _chunk5SMNV4NLjs.parse; exports.parseAspectRatio = _chunk5SMNV4NLjs.parseAspectRatio; exports.parseRangeString = _chunk5SMNV4NLjs.parseRangeString; exports.parseSlide = _chunk5SMNV4NLjs.parseSlide; exports.prettify = _chunk5SMNV4NLjs.prettify; exports.prettifySlide = _chunk5SMNV4NLjs.prettifySlide; exports.resolveConfig = _chunk5SMNV4NLjs.resolveConfig; exports.resolveFonts = _chunk5SMNV4NLjs.resolveFonts; exports.scanMonacoModules = _chunk5SMNV4NLjs.scanMonacoModules; exports.stringify = _chunk5SMNV4NLjs.stringify; exports.stringifySlide = _chunk5SMNV4NLjs.stringifySlide; exports.verifyConfig = _chunk5SMNV4NLjs.verifyConfig;
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  stringify,
15
15
  stringifySlide,
16
16
  verifyConfig
17
- } from "./chunk-RQLJEQ6S.mjs";
17
+ } from "./chunk-ZHXGSN7W.mjs";
18
18
  export {
19
19
  detectFeatures,
20
20
  filterDisabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/parser",
3
- "version": "0.38.3",
3
+ "version": "0.38.5",
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.38.3"
43
+ "@slidev/types": "0.38.5"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "rimraf dist && tsup src/index.ts src/core.ts src/fs.ts --format cjs,esm --dts --splitting --no-shims",