@md-plugins/md-plugin-blockquote 0.1.0-alpha.9 → 0.1.0-beta.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.
package/README.md CHANGED
@@ -12,12 +12,12 @@ A **Markdown-It** plugin that enhances blockquote rendering by adding customizab
12
12
  Install the plugin via your preferred package manager:
13
13
 
14
14
  ```bash
15
- # With npm:
16
- npm install @md-plugins/md-plugin-blockquote
17
- # Or with Yarn:
18
- yarn add @md-plugins/md-plugin-blockquote
19
- # Or with pnpm:
15
+ # with pnpm:
20
16
  pnpm add @md-plugins/md-plugin-blockquote
17
+ # with Yarn:
18
+ yarn add @md-plugins/md-plugin-blockquote
19
+ # with npm:
20
+ npm install @md-plugins/md-plugin-blockquote
21
21
  ```
22
22
 
23
23
  ## Usage
@@ -68,6 +68,10 @@ To run the tests, use the following command:
68
68
  pnpm test
69
69
  ```
70
70
 
71
+ ## Documentation
72
+
73
+ In case this README falls out of date, please refer to the [documentation](https://md-plugins.netlify.app/md-plugins/blockquote/overview) for the latest information.
74
+
71
75
  ## License
72
76
 
73
77
  This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
package/dist/index.d.mts CHANGED
@@ -11,4 +11,5 @@ interface BlockquotePluginOptions {
11
11
 
12
12
  declare const blockquotePlugin: PluginWithOptions<BlockquotePluginOptions>;
13
13
 
14
- export { type BlockquotePluginOptions, blockquotePlugin };
14
+ export { blockquotePlugin };
15
+ export type { BlockquotePluginOptions };
package/dist/index.d.ts CHANGED
@@ -11,4 +11,5 @@ interface BlockquotePluginOptions {
11
11
 
12
12
  declare const blockquotePlugin: PluginWithOptions<BlockquotePluginOptions>;
13
13
 
14
- export { type BlockquotePluginOptions, blockquotePlugin };
14
+ export { blockquotePlugin };
15
+ export type { BlockquotePluginOptions };
package/dist/index.mjs CHANGED
@@ -1,6 +1,17 @@
1
- const blockquotePlugin = (md, { blockquoteClass = "markdown-blockquote" } = {}) => {
1
+ function resolvePluginOptions(options, key, defaults) {
2
+ if (options && typeof options === "object" && key in options) {
3
+ return { ...defaults, ...options[key] };
4
+ }
5
+ return { ...defaults, ...options };
6
+ }
7
+
8
+ const DEFAULT_BLOCKQUOTE_OPTIONS = {
9
+ blockquoteClass: "markdown-blockquote"
10
+ };
11
+ const blockquotePlugin = (md, options) => {
12
+ const { blockquoteClass = DEFAULT_BLOCKQUOTE_OPTIONS.blockquoteClass } = resolvePluginOptions(options, "blockquotePlugin", DEFAULT_BLOCKQUOTE_OPTIONS);
2
13
  const originalRender = md.renderer.render.bind(md.renderer);
3
- md.renderer.render = (tokens, options, env) => {
14
+ md.renderer.render = (tokens, options2, env) => {
4
15
  tokens.forEach((token) => {
5
16
  if (token.tag === "blockquote" && token.type === "blockquote_open") {
6
17
  const existingClass = token.attrGet("class") || "";
@@ -8,7 +19,7 @@ const blockquotePlugin = (md, { blockquoteClass = "markdown-blockquote" } = {})
8
19
  token.attrSet("class", newClass);
9
20
  }
10
21
  });
11
- return originalRender(tokens, options, env);
22
+ return originalRender(tokens, options2, env);
12
23
  };
13
24
  };
14
25
 
package/package.json CHANGED
@@ -1,24 +1,29 @@
1
1
  {
2
2
  "name": "@md-plugins/md-plugin-blockquote",
3
- "version": "0.1.0-alpha.9",
3
+ "version": "0.1.0-beta.0",
4
4
  "description": "A markdown-it plugin for Blockquotes with custom styles.",
5
5
  "keywords": [
6
6
  "markdown-it",
7
7
  "quasarframework",
8
- "vue",
9
- "types"
8
+ "types",
9
+ "vue"
10
10
  ],
11
11
  "homepage": "https://github.com/md-plugins",
12
12
  "bugs": {
13
13
  "url": "https://github.com/md-plugins/md-plugins/issues"
14
14
  },
15
+ "license": "MIT",
16
+ "author": "hawkeye64 <galbraith64@gmail.com>",
15
17
  "repository": {
16
18
  "type": "git",
17
19
  "url": "git+https://github.com/md-plugins/md-plugins.git"
18
20
  },
19
- "license": "MIT",
20
- "author": "hawkeye64 <galbraith64@gmail.com>",
21
+ "files": [
22
+ "./dist"
23
+ ],
21
24
  "type": "module",
25
+ "module": "./dist/index.mjs",
26
+ "types": "./dist/index.d.ts",
22
27
  "exports": {
23
28
  ".": {
24
29
  "import": {
@@ -27,22 +32,17 @@
27
32
  }
28
33
  }
29
34
  },
30
- "module": "./dist/index.mjs",
31
- "types": "./dist/index.d.ts",
32
- "files": [
33
- "./dist"
34
- ],
35
- "dependencies": {
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "devDependencies": {
36
39
  "@types/markdown-it": "^14.1.2",
37
- "markdown-it": "^14.1.0",
38
- "@md-plugins/shared": "0.1.0-alpha.9"
40
+ "markdown-it": "^14.1.1",
41
+ "@md-plugins/shared": "0.1.0-beta.0"
39
42
  },
40
43
  "peerDependencies": {
41
44
  "markdown-it": "^14.1.0"
42
45
  },
43
- "publishConfig": {
44
- "access": "public"
45
- },
46
46
  "scripts": {
47
47
  "build": "unbuild",
48
48
  "clean": "rm -rf dist/ node_modules/",