@vuepress/markdown
Advanced tools
Comparing version 2.0.0-rc.15 to 2.0.0-rc.16
@@ -92,15 +92,15 @@ import { SfcPluginOptions } from '@mdit-vue/plugin-sfc'; | ||
interface MarkdownOptions extends Options$1 { | ||
anchor?: false | AnchorPluginOptions; | ||
assets?: false | AssetsPluginOptions; | ||
anchor?: AnchorPluginOptions | false; | ||
assets?: AssetsPluginOptions | false; | ||
component?: false; | ||
emoji?: false | EmojiPluginOptions; | ||
frontmatter?: false | FrontmatterPluginOptions; | ||
headers?: false | HeadersPluginOptions; | ||
emoji?: EmojiPluginOptions | false; | ||
frontmatter?: FrontmatterPluginOptions | false; | ||
headers?: HeadersPluginOptions | false; | ||
title?: false; | ||
importCode?: false | ImportCodePluginOptions; | ||
links?: false | LinksPluginOptions; | ||
sfc?: false | SfcPluginOptions; | ||
importCode?: ImportCodePluginOptions | false; | ||
links?: LinksPluginOptions | false; | ||
sfc?: SfcPluginOptions | false; | ||
slugify?: MarkdownSlugifyFunction; | ||
toc?: false | TocPluginOptions; | ||
vPre?: false | VPrePluginOptions; | ||
toc?: TocPluginOptions | false; | ||
vPre?: VPrePluginOptions | false; | ||
/** | ||
@@ -107,0 +107,0 @@ * @deprecated This feature has been removed. Please use `@vuepress/plugin-prismjs` or `@vuepress/plugin-shiki` instead. |
@@ -21,3 +21,3 @@ // src/markdown.ts | ||
// src/plugins/anchorPlugin.ts | ||
import { default as anchorPlugin } from "markdown-it-anchor"; | ||
import anchorPlugin from "markdown-it-anchor"; | ||
@@ -85,3 +85,3 @@ // src/plugins/assetsPlugin/resolveLink.ts | ||
/^([^ ]*?)([ \n].*)?$/, | ||
(_2, url, descriptor = "") => `${resolveLink(url.trim(), { | ||
(__, url, descriptor = "") => `${resolveLink(url.trim(), { | ||
env, | ||
@@ -185,5 +185,8 @@ absolutePathPrependBase, | ||
); | ||
md.renderer.rules.import_code = (tokens, idx, options2, env, slf) => { | ||
md.renderer.rules.import_code = (tokens, idx, opts, env, slf) => { | ||
const token = tokens[idx]; | ||
const { importFilePath, importCode } = resolveImportCode(token.meta, env); | ||
const { importFilePath, importCode } = resolveImportCode( | ||
token.meta, | ||
env | ||
); | ||
token.content = importCode; | ||
@@ -194,3 +197,3 @@ if (importFilePath) { | ||
} | ||
return md.renderer.rules.fence(tokens, idx, options2, env, slf); | ||
return md.renderer.rules.fence(tokens, idx, opts, env, slf); | ||
}; | ||
@@ -216,14 +219,12 @@ }; | ||
} | ||
} else if (filePathRelative) { | ||
relativePath = path4.join( | ||
// file path may contain non-ASCII characters | ||
path4.dirname(encodeURI(filePathRelative)), | ||
rawPath | ||
); | ||
absolutePath = path4.join(base, relativePath); | ||
} else { | ||
if (filePathRelative) { | ||
relativePath = path4.join( | ||
// file path may contain non-ASCII characters | ||
path4.dirname(encodeURI(filePathRelative)), | ||
rawPath | ||
); | ||
absolutePath = path4.join(base, relativePath); | ||
} else { | ||
relativePath = rawPath.replace(/^(?:\.\/)?(.*)$/, "$1"); | ||
absolutePath = null; | ||
} | ||
relativePath = rawPath.replace(/^(?:\.\/)?(.*)$/, "$1"); | ||
absolutePath = null; | ||
} | ||
@@ -255,5 +256,5 @@ return { | ||
if (isLinkExternal(hrefLink, base)) { | ||
Object.entries(externalAttrs).forEach( | ||
([key, val]) => token.attrSet(key, val) | ||
); | ||
Object.entries(externalAttrs).forEach(([key, val]) => { | ||
token.attrSet(key, val); | ||
}); | ||
return; | ||
@@ -293,7 +294,7 @@ } | ||
}; | ||
md.renderer.rules.link_open = (tokens, idx, options2, env, self) => { | ||
md.renderer.rules.link_open = (tokens, idx, opts, env, self) => { | ||
handleLinkOpen(tokens, idx, env); | ||
return self.renderToken(tokens, idx, options2); | ||
return self.renderToken(tokens, idx, opts); | ||
}; | ||
md.renderer.rules.link_close = (tokens, idx, options2, _env, self) => { | ||
md.renderer.rules.link_close = (tokens, idx, opts, _env, self) => { | ||
if (hasOpenInternalLink) { | ||
@@ -303,3 +304,3 @@ hasOpenInternalLink = false; | ||
} | ||
return self.renderToken(tokens, idx, options2); | ||
return self.renderToken(tokens, idx, opts); | ||
}; | ||
@@ -345,2 +346,3 @@ }; | ||
assets, | ||
// eslint-disable-next-line @typescript-eslint/no-deprecated | ||
code, | ||
@@ -383,3 +385,3 @@ vPre, | ||
`\`markdown.code\` option has been removed, please use '@vuepress/plugin-shiki' or '@vuepress/plugin-prismjs' instead. | ||
See https://v2.vuepress.vuejs.org/reference/config.html#markdown-code` | ||
See https://vuepress.vuejs.org/reference/config.html#markdown-code` | ||
); | ||
@@ -386,0 +388,0 @@ } |
{ | ||
"name": "@vuepress/markdown", | ||
"version": "2.0.0-rc.15", | ||
"version": "2.0.0-rc.16", | ||
"description": "Markdown package of VuePress", | ||
@@ -41,7 +41,7 @@ "keywords": [ | ||
"markdown-it": "^14.1.0", | ||
"markdown-it-anchor": "^9.0.1", | ||
"markdown-it-anchor": "^9.2.0", | ||
"markdown-it-emoji": "^3.0.0", | ||
"mdurl": "^2.0.0", | ||
"@vuepress/utils": "2.0.0-rc.15", | ||
"@vuepress/shared": "2.0.0-rc.15" | ||
"@vuepress/utils": "2.0.0-rc.16", | ||
"@vuepress/shared": "2.0.0-rc.16" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
@@ -8,3 +8,3 @@ # @vuepress/markdown | ||
https://v2.vuepress.vuejs.org | ||
https://vuepress.vuejs.org | ||
@@ -11,0 +11,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21338
584
1
+ Added@types/node@22.8.6(transitive)
+ Added@vuepress/shared@2.0.0-rc.16(transitive)
+ Added@vuepress/utils@2.0.0-rc.16(transitive)
+ Addedora@8.1.1(transitive)
- Removed@types/node@22.8.4(transitive)
- Removed@vuepress/shared@2.0.0-rc.15(transitive)
- Removed@vuepress/utils@2.0.0-rc.15(transitive)
- Removedora@8.1.0(transitive)
Updated@vuepress/shared@2.0.0-rc.16
Updated@vuepress/utils@2.0.0-rc.16
Updatedmarkdown-it-anchor@^9.2.0