Skip to content

Commit 78a8431

Browse files
committed
refactor(markdown): normalize plugins entry
1 parent d1b2b63 commit 78a8431

File tree

7 files changed

+22
-24
lines changed

7 files changed

+22
-24
lines changed

packages/markdown/src/markdown.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,9 @@ export const createMarkdown = ({
6565

6666
// add anchor to headers
6767
if (anchor !== false) {
68-
// @ts-expect-error: types error with markdown-it-anchor
6968
md.use<AnchorPluginOptions>(anchorPlugin, {
7069
level: [1, 2, 3, 4, 5, 6],
7170
slugify,
72-
// @ts-expect-error: types error with markdown-it-anchor
7371
permalink: anchorPlugin.permalink.ariaHidden({
7472
class: 'header-anchor',
7573
symbol: '#',

packages/markdown/src/plugins.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,24 @@ export { sfcPlugin, type SfcPluginOptions } from '@mdit-vue/plugin-sfc'
1414
export { titlePlugin } from '@mdit-vue/plugin-title'
1515
export { tocPlugin, type TocPluginOptions } from '@mdit-vue/plugin-toc'
1616

17-
export * from './plugins/anchorPlugin.js'
18-
export * from './plugins/assetsPlugin.js'
19-
export * from './plugins/codePlugin.js'
20-
export * from './plugins/emojiPlugin.js'
21-
export * from './plugins/importCodePlugin.js'
22-
export * from './plugins/linksPlugin.js'
17+
export {
18+
anchorPlugin,
19+
type AnchorPluginOptions,
20+
} from './plugins/anchorPlugin.js'
21+
export {
22+
assetsPlugin,
23+
type AssetsPluginOptions,
24+
} from './plugins/assetsPlugin/assetsPlugin.js'
25+
export {
26+
codePlugin,
27+
type CodePluginOptions,
28+
} from './plugins/codePlugin/codePlugin.js'
29+
export { emojiPlugin, type EmojiPluginOptions } from './plugins/emojiPlugin.js'
30+
export {
31+
importCodePlugin,
32+
type ImportCodePluginOptions,
33+
} from './plugins/importCodePlugin/importCodePlugin.js'
34+
export {
35+
linksPlugin,
36+
type LinksPluginOptions,
37+
} from './plugins/linksPlugin/linksPlugin.js'
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import anchorPlugin from 'markdown-it-anchor'
1+
import { default as anchorPlugin } from 'markdown-it-anchor'
22

3-
// @ts-expect-error: types error with markdown-it-anchor
43
export type AnchorPluginOptions = anchorPlugin.AnchorOptions
54
export { anchorPlugin }

packages/markdown/src/plugins/assetsPlugin.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/markdown/src/plugins/codePlugin.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/markdown/src/plugins/importCodePlugin.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/markdown/src/plugins/linksPlugin.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)