@mdit-vue/plugin-frontmatter 2.1.3 → 2.1.4

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/index.cjs CHANGED
@@ -7,8 +7,8 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
7
7
  const grayMatter__default = /*#__PURE__*/_interopDefaultCompat(grayMatter);
8
8
 
9
9
  const frontmatterPlugin = (md, { grayMatterOptions, renderExcerpt = true } = {}) => {
10
- const render = md.render.bind(md);
11
- md.render = (src, env = {}) => {
10
+ const parse = md.parse.bind(md);
11
+ md.parse = (src, env = {}) => {
12
12
  const { data, content, excerpt = "" } = grayMatter__default(src, grayMatterOptions);
13
13
  env.content = content;
14
14
  env.frontmatter = {
@@ -20,12 +20,12 @@ const frontmatterPlugin = (md, { grayMatterOptions, renderExcerpt = true } = {})
20
20
  // render the excerpt with original markdown-it render method.
21
21
  // here we spread `env` to avoid mutating the original object.
22
22
  // using deep clone might be a safer choice.
23
- render(excerpt, { ...env })
23
+ md.render(excerpt, { ...env })
24
24
  ) : (
25
25
  // use the raw excerpt directly
26
26
  excerpt
27
27
  );
28
- return render(content, env);
28
+ return parse(content, env);
29
29
  };
30
30
  };
31
31
 
package/dist/index.d.cts CHANGED
@@ -46,4 +46,5 @@ declare module '@mdit-vue/types' {
46
46
  */
47
47
  declare const frontmatterPlugin: PluginWithOptions<FrontmatterPluginOptions>;
48
48
 
49
- export { type FrontmatterPluginOptions, frontmatterPlugin };
49
+ export { frontmatterPlugin };
50
+ export type { FrontmatterPluginOptions };
package/dist/index.d.mts CHANGED
@@ -46,4 +46,5 @@ declare module '@mdit-vue/types' {
46
46
  */
47
47
  declare const frontmatterPlugin: PluginWithOptions<FrontmatterPluginOptions>;
48
48
 
49
- export { type FrontmatterPluginOptions, frontmatterPlugin };
49
+ export { frontmatterPlugin };
50
+ export type { FrontmatterPluginOptions };
package/dist/index.d.ts CHANGED
@@ -46,4 +46,5 @@ declare module '@mdit-vue/types' {
46
46
  */
47
47
  declare const frontmatterPlugin: PluginWithOptions<FrontmatterPluginOptions>;
48
48
 
49
- export { type FrontmatterPluginOptions, frontmatterPlugin };
49
+ export { frontmatterPlugin };
50
+ export type { FrontmatterPluginOptions };
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import grayMatter from 'gray-matter';
2
2
 
3
3
  const frontmatterPlugin = (md, { grayMatterOptions, renderExcerpt = true } = {}) => {
4
- const render = md.render.bind(md);
5
- md.render = (src, env = {}) => {
4
+ const parse = md.parse.bind(md);
5
+ md.parse = (src, env = {}) => {
6
6
  const { data, content, excerpt = "" } = grayMatter(src, grayMatterOptions);
7
7
  env.content = content;
8
8
  env.frontmatter = {
@@ -14,12 +14,12 @@ const frontmatterPlugin = (md, { grayMatterOptions, renderExcerpt = true } = {})
14
14
  // render the excerpt with original markdown-it render method.
15
15
  // here we spread `env` to avoid mutating the original object.
16
16
  // using deep clone might be a safer choice.
17
- render(excerpt, { ...env })
17
+ md.render(excerpt, { ...env })
18
18
  ) : (
19
19
  // use the raw excerpt directly
20
20
  excerpt
21
21
  );
22
- return render(content, env);
22
+ return parse(content, env);
23
23
  };
24
24
  };
25
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdit-vue/plugin-frontmatter",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "A markdown-it plugin to get markdown frontmatter",
5
5
  "keywords": [
6
6
  "markdown-it",
@@ -43,13 +43,13 @@
43
43
  "test": "vitest"
44
44
  },
45
45
  "dependencies": {
46
- "@mdit-vue/types": "2.1.0",
47
- "@types/markdown-it": "^14.1.1",
46
+ "@mdit-vue/types": "2.1.4",
47
+ "@types/markdown-it": "^14.1.2",
48
48
  "gray-matter": "^4.0.3",
49
49
  "markdown-it": "^14.1.0"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"
53
53
  },
54
- "gitHead": "0b0ff6922bba2627dad6b9cf0e4249f0a9ecbe15"
54
+ "gitHead": "01a6daa37fff48ea3992becfd4ba8c0f97a605ad"
55
55
  }