@mdit-vue/plugin-title 3.0.0 → 3.0.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { PluginSimple } from 'markdown-it';
1
+ import { PluginSimple } from "markdown-it";
2
+
3
+ //#region src/title-plugin.d.ts
2
4
 
3
5
  /**
4
6
  * Get markdown page title info
@@ -6,14 +8,15 @@ import { PluginSimple } from 'markdown-it';
6
8
  * Extract it into env
7
9
  */
8
10
  declare const titlePlugin: PluginSimple;
9
-
11
+ //#endregion
12
+ //#region src/types.d.ts
10
13
  declare module '@mdit-vue/types' {
11
- interface MarkdownItEnv {
12
- /**
13
- * The title that extracted by `@mdit-vue/plugin-title`
14
- */
15
- title?: string;
16
- }
14
+ interface MarkdownItEnv {
15
+ /**
16
+ * The title that extracted by `@mdit-vue/plugin-title`
17
+ */
18
+ title?: string;
19
+ }
17
20
  }
18
-
19
- export { titlePlugin };
21
+ //#endregion
22
+ export { titlePlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdit-vue/plugin-title",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "A markdown-it plugin to get markdown page title",
5
5
  "keywords": [
6
6
  "markdown-it",
@@ -20,32 +20,30 @@
20
20
  "author": "meteorlxy <meteor.lxy@foxmail.com>",
21
21
  "type": "module",
22
22
  "exports": {
23
- ".": {
24
- "import": "./dist/index.mjs",
25
- "require": "./dist/index.cjs"
26
- },
23
+ ".": "./dist/index.js",
27
24
  "./package.json": "./package.json"
28
25
  },
29
- "main": "./dist/index.cjs",
30
- "module": "./dist/index.mjs",
31
- "types": "./dist/index.d.cts",
26
+ "main": "./dist/index.js",
27
+ "module": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
32
29
  "files": [
33
30
  "./dist"
34
31
  ],
35
32
  "scripts": {
36
33
  "build": "tsdown",
34
+ "clean": "rimraf ./dist",
37
35
  "test": "vitest"
38
36
  },
39
37
  "dependencies": {
40
- "@mdit-vue/shared": "3.0.0",
41
- "@mdit-vue/types": "3.0.0",
38
+ "@mdit-vue/shared": "3.0.2",
39
+ "@mdit-vue/types": "3.0.2",
42
40
  "@types/markdown-it": "^14.1.2",
43
41
  "markdown-it": "^14.1.0"
44
42
  },
45
43
  "devDependencies": {
46
44
  "@types/markdown-it-emoji": "^3.0.1",
47
45
  "markdown-it-emoji": "^3.0.0",
48
- "tsdown": "^0.14.0",
46
+ "tsdown": "^0.14.1",
49
47
  "vitest": "^3.2.4"
50
48
  },
51
49
  "engines": {
@@ -54,5 +52,5 @@
54
52
  "publishConfig": {
55
53
  "access": "public"
56
54
  },
57
- "gitHead": "bbb62a47109c2932505b3f570b963f70d590914f"
55
+ "gitHead": "3b5332d09fbd927319bd8be3ba3b86b3d12d1ec8"
58
56
  }
package/dist/index.cjs DELETED
@@ -1,45 +0,0 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
11
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
- value: mod,
20
- enumerable: true
21
- }) : target, mod));
22
-
23
- //#endregion
24
- const __mdit_vue_shared = __toESM(require("@mdit-vue/shared"));
25
-
26
- //#region src/title-plugin.ts
27
- /**
28
- * Get markdown page title info
29
- *
30
- * Extract it into env
31
- */
32
- const titlePlugin = (md) => {
33
- const render = md.renderer.render.bind(md.renderer);
34
- md.renderer.render = (tokens, options, env) => {
35
- const tokenIdx = tokens.findIndex((token) => token.tag === "h1");
36
- env.title = tokenIdx > -1 ? (0, __mdit_vue_shared.resolveTitleFromToken)(tokens[tokenIdx + 1], {
37
- shouldAllowHtml: false,
38
- shouldEscapeText: false
39
- }) : "";
40
- return render(tokens, options, env);
41
- };
42
- };
43
-
44
- //#endregion
45
- exports.titlePlugin = titlePlugin;
package/dist/index.d.cts DELETED
@@ -1,12 +0,0 @@
1
- import { PluginSimple } from "markdown-it";
2
-
3
- //#region src/title-plugin.d.ts
4
-
5
- /**
6
- * Get markdown page title info
7
- *
8
- * Extract it into env
9
- */
10
- declare const titlePlugin: PluginSimple;
11
- //#endregion
12
- export { titlePlugin };
package/dist/index.d.mts DELETED
@@ -1,12 +0,0 @@
1
- import { PluginSimple } from "markdown-it";
2
-
3
- //#region src/title-plugin.d.ts
4
-
5
- /**
6
- * Get markdown page title info
7
- *
8
- * Extract it into env
9
- */
10
- declare const titlePlugin: PluginSimple;
11
- //#endregion
12
- export { titlePlugin };
File without changes