Skip to content

Commit 0a5d4eb

Browse files
committedApr 8, 2024
feat(markdown): upgrade markdown-it type to v14
1 parent 6222aca commit 0a5d4eb

File tree

7 files changed

+81
-78
lines changed

7 files changed

+81
-78
lines changed
 

‎packages/markdown/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131
"clean": "rimraf dist"
3232
},
3333
"dependencies": {
34-
"@mdit-vue/plugin-component": "^2.0.0",
35-
"@mdit-vue/plugin-frontmatter": "^2.0.0",
36-
"@mdit-vue/plugin-headers": "^2.0.0",
37-
"@mdit-vue/plugin-sfc": "^2.0.0",
38-
"@mdit-vue/plugin-title": "^2.0.0",
39-
"@mdit-vue/plugin-toc": "^2.0.0",
40-
"@mdit-vue/shared": "^2.0.0",
41-
"@mdit-vue/types": "^2.0.0",
42-
"@types/markdown-it": "^13.0.7",
43-
"@types/markdown-it-emoji": "^2.0.4",
34+
"@mdit-vue/plugin-component": "^2.1.0",
35+
"@mdit-vue/plugin-frontmatter": "^2.1.0",
36+
"@mdit-vue/plugin-headers": "^2.1.0",
37+
"@mdit-vue/plugin-sfc": "^2.1.0",
38+
"@mdit-vue/plugin-title": "^2.1.0",
39+
"@mdit-vue/plugin-toc": "^2.1.0",
40+
"@mdit-vue/shared": "^2.1.0",
41+
"@mdit-vue/types": "^2.1.0",
42+
"@types/markdown-it": "^14.0.0",
43+
"@types/markdown-it-emoji": "^2.0.5",
4444
"@vuepress/shared": "workspace:*",
4545
"@vuepress/utils": "workspace:*",
4646
"markdown-it": "^14.1.0",

‎packages/markdown/src/plugins/assetsPlugin/assetsPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { PluginWithOptions } from 'markdown-it'
2-
import type { RenderRule } from 'markdown-it/lib/renderer.js'
2+
import type { RenderRule } from 'markdown-it/lib/renderer.mjs'
33
import type { MarkdownEnv } from '../../types.js'
44
import { resolveLink } from './resolveLink.js'
55

‎packages/markdown/src/plugins/importCodePlugin/createImportCodeBlockRule.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { path } from '@vuepress/utils'
2-
import type { RuleBlock } from 'markdown-it/lib/parser_block.js'
2+
import type ParserBlock from 'markdown-it/lib/parser_block.mjs'
33
import type { ImportCodePluginOptions } from './importCodePlugin.js'
44
import type { ImportCodeTokenMeta } from './types.js'
55

@@ -13,7 +13,9 @@ const START_CODES = [64, 91, 99, 111, 100, 101]
1313
const SYNTAX_RE = /^@\[code(?:{(?:(\d+)?-(\d+)?)})?(?: ([^\]]+))?\]\(([^)]*)\)/
1414

1515
export const createImportCodeBlockRule =
16-
({ handleImportPath = (str) => str }: ImportCodePluginOptions): RuleBlock =>
16+
({
17+
handleImportPath = (str) => str,
18+
}: ImportCodePluginOptions): ParserBlock.RuleBlock =>
1719
(state, startLine, endLine, silent): boolean => {
1820
// if it's indented more than 3 spaces, it should be a code block
1921
/* istanbul ignore if */

‎packages/markdown/src/plugins/linksPlugin/linksPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { isLinkExternal, normalizeRoutePath } from '@vuepress/shared'
22
import type { PluginWithOptions } from 'markdown-it'
3-
import type Token from 'markdown-it/lib/token.js'
3+
import type Token from 'markdown-it/lib/token.mjs'
44
import type { MarkdownEnv } from '../../types.js'
55
import { resolvePaths } from './resolvePaths.js'
66

‎packages/markdown/src/types.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { MarkdownSfcBlocks } from '@mdit-vue/plugin-sfc'
22
import type { MarkdownItEnv } from '@mdit-vue/types'
33
import type { PageFrontmatter, PageHeader } from '@vuepress/shared'
44
import type MarkdownIt from 'markdown-it'
5+
import type { Options } from 'markdown-it'
56
import type {
67
AnchorPluginOptions,
78
AssetsPluginOptions,
@@ -18,7 +19,7 @@ import type {
1819
export type Markdown = MarkdownIt
1920
export type { MarkdownSfcBlocks }
2021

21-
export interface MarkdownOptions extends MarkdownIt.Options {
22+
export interface MarkdownOptions extends Options {
2223
anchor?: false | AnchorPluginOptions
2324
assets?: false | AssetsPluginOptions
2425
code?: false | CodePluginOptions

‎packages/shared/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"clean": "rimraf dist"
3434
},
3535
"dependencies": {
36-
"@mdit-vue/types": "^2.0.0"
36+
"@mdit-vue/types": "^2.1.0"
3737
},
3838
"publishConfig": {
3939
"access": "public"

‎pnpm-lock.yaml

+62-62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.