@md-plugins/md-plugin-blockquote 0.1.0-alpha.8 → 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 +9 -5
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +14 -3
- package/package.json +16 -16
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
|
-
#
|
|
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
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
|
|
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,
|
|
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,
|
|
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-
|
|
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
|
-
"
|
|
9
|
-
"
|
|
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
|
-
"
|
|
20
|
-
|
|
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
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
],
|
|
35
|
-
"dependencies": {
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
36
39
|
"@types/markdown-it": "^14.1.2",
|
|
37
|
-
"markdown-it": "^14.1.
|
|
38
|
-
"@md-plugins/shared": "0.1.0-
|
|
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/",
|