@slidev/parser 0.47.1 → 0.47.2

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.
@@ -286,21 +286,25 @@ function safeParseYAML(str) {
286
286
  }
287
287
  function matter(code) {
288
288
  let type;
289
+ let raw;
289
290
  const data = {};
290
291
  let content = code.replace(/^---.*\r?\n([\s\S]*?)---/, (_, f) => {
291
292
  type = "frontmatter";
293
+ raw = f;
292
294
  Object.assign(data, safeParseYAML(f));
293
295
  return "";
294
296
  });
295
297
  if (type !== "frontmatter") {
296
298
  content = content.replace(/^\s*```ya?ml([\s\S]*?)```/, (_, d) => {
297
299
  type = "yaml";
300
+ raw = d;
298
301
  Object.assign(data, safeParseYAML(d));
299
302
  return "";
300
303
  });
301
304
  }
302
305
  return {
303
306
  type,
307
+ raw,
304
308
  data,
305
309
  content
306
310
  };
@@ -344,6 +348,7 @@ function parseSlide(raw) {
344
348
  content,
345
349
  frontmatter,
346
350
  frontmatterStyle: matterResult.type,
351
+ frontmatterRaw: matterResult.raw,
347
352
  note
348
353
  };
349
354
  }
package/dist/core.mjs CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  stringify,
16
16
  stringifySlide,
17
17
  verifyConfig
18
- } from "./chunk-3PHEOYPJ.mjs";
18
+ } from "./chunk-3UOELSP3.mjs";
19
19
  export {
20
20
  detectFeatures,
21
21
  filterDisabled,
package/dist/fs.mjs CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  stringify,
16
16
  stringifySlide,
17
17
  verifyConfig
18
- } from "./chunk-3PHEOYPJ.mjs";
18
+ } from "./chunk-3UOELSP3.mjs";
19
19
 
20
20
  // src/fs.ts
21
21
  import { promises as fs } from "node:fs";
package/dist/index.mjs CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  stringify,
16
16
  stringifySlide,
17
17
  verifyConfig
18
- } from "./chunk-3PHEOYPJ.mjs";
18
+ } from "./chunk-3UOELSP3.mjs";
19
19
  export {
20
20
  detectFeatures,
21
21
  filterDisabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/parser",
3
- "version": "0.47.1",
3
+ "version": "0.47.2",
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.47.1"
43
+ "@slidev/types": "0.47.2"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "rimraf dist && tsup src/index.ts src/core.ts src/fs.ts",