@vuepress/markdown
Advanced tools
Comparing version 2.0.0-rc.17 to 2.0.0-rc.18
@@ -48,8 +48,2 @@ import { SfcPluginOptions } from '@mdit-vue/plugin-sfc'; | ||
/** | ||
* Tag for internal links | ||
* | ||
* @default 'RouteLink' | ||
*/ | ||
internalTag?: 'a' | 'RouteLink' | 'RouterLink'; | ||
/** | ||
* Additional attributes for external links | ||
@@ -66,2 +60,14 @@ * | ||
externalAttrs?: Record<string, string>; | ||
/** | ||
* Tag for internal links | ||
* | ||
* @default 'RouteLink' | ||
*/ | ||
internalTag?: 'a' | 'RouteLink' | 'RouterLink'; | ||
/** | ||
* Method to check if a link is external | ||
* | ||
* @default import { isLinkExternal } from '@vuepress/shared' | ||
*/ | ||
isExternal?: (href: string, env: MarkdownEnv) => boolean; | ||
} | ||
@@ -68,0 +74,0 @@ /** |
@@ -235,2 +235,3 @@ // src/markdown.ts | ||
const internalTag = options.internalTag || "RouteLink"; | ||
const isExternal = options.isExternal ?? ((href, env) => isLinkExternal(href, env.base)); | ||
const externalAttrs = { | ||
@@ -251,3 +252,3 @@ target: "_blank", | ||
const { base = "/", filePathRelative = null } = env; | ||
if (isLinkExternal(hrefLink, base)) { | ||
if (isExternal(hrefLink, env)) { | ||
Object.entries(externalAttrs).forEach(([key, val]) => { | ||
@@ -254,0 +255,0 @@ token.attrSet(key, val); |
{ | ||
"name": "@vuepress/markdown", | ||
"version": "2.0.0-rc.17", | ||
"version": "2.0.0-rc.18", | ||
"description": "Markdown package of VuePress", | ||
@@ -44,4 +44,4 @@ "keywords": [ | ||
"mdurl": "^2.0.0", | ||
"@vuepress/shared": "2.0.0-rc.17", | ||
"@vuepress/utils": "2.0.0-rc.17" | ||
"@vuepress/shared": "2.0.0-rc.18", | ||
"@vuepress/utils": "2.0.0-rc.18" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
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
21621
591
+ Added@vuepress/shared@2.0.0-rc.18(transitive)
+ Added@vuepress/utils@2.0.0-rc.18(transitive)
- Removed@vuepress/shared@2.0.0-rc.17(transitive)
- Removed@vuepress/utils@2.0.0-rc.17(transitive)
Updated@vuepress/shared@2.0.0-rc.18
Updated@vuepress/utils@2.0.0-rc.18