vitepress-plugin-abbr 0.5.0 → 0.7.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
@@ -75,25 +75,19 @@ export default defineConfig({
75
75
  md.use(abbrMarkdownPlugin)
76
76
  },
77
77
  },
78
- vite: {
79
- ssr: {
80
- noExternal: ['vitepress-plugin-abbr'],
81
- },
82
- },
83
78
  })
84
79
  ```
85
80
 
86
81
  ```ts
87
82
  // .vitepress/theme/index.ts
88
83
  import type { Theme } from 'vitepress'
89
- import { VPAbbreviation } from 'vitepress-plugin-abbr/client'
84
+ import { EnhanceAppWithAbbr } from 'vitepress-plugin-abbr/client'
90
85
  import DefaultTheme from 'vitepress/theme'
91
- import 'vitepress-plugin-abbr/style.css'
92
86
 
93
87
  export default {
94
88
  extends: DefaultTheme,
95
89
  enhanceApp(ctx) {
96
- ctx.app.component('VPAbbreviation', VPAbbreviation)
90
+ EnhanceAppWithAbbr(ctx)
97
91
  },
98
92
  } satisfies Theme
99
93
  ```
@@ -178,7 +178,8 @@ const abbrMarkdownPlugin = (md, globalAbbreviations = {}) => {
178
178
  ...cleanMarkdownEnv(env, ["abbreviations"]),
179
179
  disableAbbrReplace: true
180
180
  });
181
- return `<VPAbbreviation aria-label="${rendered.replace(/<[^>]*>/g, "")}">${content}${info ? `<template #tooltip>${rendered}</template>` : ""}</VPAbbreviation>`;
181
+ const label = rendered.replace(/<[^>]*>/g, "");
182
+ return `<VPAbbreviation aria-label="${md.utils.escapeHtml(label)}">${content}${info ? `<template #tooltip>${rendered}</template>` : ""}</VPAbbreviation>`;
182
183
  };
183
184
  };
184
185
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vitepress-plugin-abbr",
3
3
  "type": "module",
4
- "version": "0.5.0",
4
+ "version": "0.7.0",
5
5
  "description": "Add abbreviation support to VitePress",
6
6
  "author": "pengzhanbo <q942450674@outlook.com> (https://github.com/pengzhanbo/)",
7
7
  "license": "MIT",
@@ -39,9 +39,8 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@floating-ui/vue": "^2.0.0",
42
- "@vueuse/core": "^14.3.0",
43
- "vitepress-plugin-toolkit": "0.5.0",
44
- "vitepress-tuck": "0.5.0"
42
+ "vitepress-plugin-toolkit": "0.7.0",
43
+ "vitepress-tuck": "0.7.0"
45
44
  },
46
45
  "publishConfig": {
47
46
  "access": "public",