@md-plugins/md-plugin-inlinecode 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
@@ -13,12 +13,12 @@ A **Markdown-It** plugin that enhances inline code rendering by adding customiza
13
13
  Install the plugin via your preferred package manager:
14
14
 
15
15
  ```bash
16
- # With npm:
17
- npm install @md-plugins/md-plugin-inlinecode
18
- # Or with Yarn:
19
- yarn add @md-plugins/md-plugin-inlinecode
20
- # Or with pnpm:
16
+ # with pnpm:
21
17
  pnpm add @md-plugins/md-plugin-inlinecode
18
+ # with Yarn:
19
+ yarn add @md-plugins/md-plugin-inlinecode
20
+ # with npm:
21
+ npm install @md-plugins/md-plugin-inlinecode
22
22
  ```
23
23
 
24
24
  ## Usage
@@ -67,6 +67,10 @@ Run the tests to ensure the plugin behaves as expected:
67
67
  pnpm test
68
68
  ```
69
69
 
70
+ ## Documentation
71
+
72
+ In case this README falls out of date, please refer to the [documentation](https://md-plugins.netlify.app/md-plugins/inline-code/overview) for the latest information.
73
+
70
74
  ## License
71
75
 
72
76
  This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
package/dist/index.d.mts CHANGED
@@ -14,4 +14,5 @@ interface InlineCodePluginOptions {
14
14
  */
15
15
  declare const inlinecodePlugin: PluginWithOptions<InlineCodePluginOptions>;
16
16
 
17
- export { type InlineCodePluginOptions, inlinecodePlugin };
17
+ export { inlinecodePlugin };
18
+ export type { InlineCodePluginOptions };
package/dist/index.d.ts CHANGED
@@ -14,4 +14,5 @@ interface InlineCodePluginOptions {
14
14
  */
15
15
  declare const inlinecodePlugin: PluginWithOptions<InlineCodePluginOptions>;
16
16
 
17
- export { type InlineCodePluginOptions, inlinecodePlugin };
17
+ export { inlinecodePlugin };
18
+ export type { InlineCodePluginOptions };
package/dist/index.mjs CHANGED
@@ -1,6 +1,21 @@
1
1
  import { escapeHtml } from 'markdown-it/lib/common/utils.mjs';
2
2
 
3
- const inlinecodePlugin = (md, { inlineCodeClass = "markdown-token" } = {}) => {
3
+ function resolvePluginOptions(options, key, defaults) {
4
+ if (options && typeof options === "object" && key in options) {
5
+ return { ...defaults, ...options[key] };
6
+ }
7
+ return { ...defaults, ...options };
8
+ }
9
+
10
+ const DEFAULT_INLINECODE_PLUGIN_OPTIONS = {
11
+ inlineCodeClass: "markdown-token"
12
+ };
13
+ const inlinecodePlugin = (md, options) => {
14
+ const { inlineCodeClass } = resolvePluginOptions(
15
+ options,
16
+ "inlinecodePlugin",
17
+ DEFAULT_INLINECODE_PLUGIN_OPTIONS
18
+ );
4
19
  md.renderer.rules.code_inline = (tokens, idx, _options, _env, self) => {
5
20
  const token = tokens[idx];
6
21
  if (!token) {
package/package.json CHANGED
@@ -1,24 +1,29 @@
1
1
  {
2
2
  "name": "@md-plugins/md-plugin-inlinecode",
3
- "version": "0.1.0-alpha.9",
3
+ "version": "0.1.0-beta.0",
4
4
  "description": "A markdown-it plugin for handling inline code.",
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,24 +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": {
36
- "markdown-it": "^14.1.0",
37
- "@md-plugins/shared": "0.1.0-alpha.9"
35
+ "publishConfig": {
36
+ "access": "public"
38
37
  },
39
38
  "devDependencies": {
40
- "@types/markdown-it": "^14.1.2"
39
+ "@types/markdown-it": "^14.1.2",
40
+ "markdown-it": "^14.1.1",
41
+ "@md-plugins/shared": "0.1.0-beta.0"
41
42
  },
42
43
  "peerDependencies": {
43
44
  "markdown-it": "^14.1.0"
44
45
  },
45
- "publishConfig": {
46
- "access": "public"
47
- },
48
46
  "scripts": {
49
47
  "build": "unbuild",
50
48
  "clean": "rm -rf dist/ node_modules/",