@vuepress/markdown
Advanced tools
Comparing version 2.0.0-rc.4 to 2.0.0-rc.5
@@ -90,5 +90,5 @@ import { SfcPluginOptions } from '@mdit-vue/plugin-sfc'; | ||
* | ||
* @default 'VPLink' | ||
* @default 'RouteLink' | ||
*/ | ||
internalTag?: 'a' | 'VPLink' | 'RouterLink'; | ||
internalTag?: 'a' | 'RouteLink' | 'RouterLink'; | ||
/** | ||
@@ -110,4 +110,4 @@ * Additional attributes for external links | ||
* | ||
* - internal links: convert them into `<VPLink>` | ||
* - external links: add extra attrs and external icon | ||
* - internal links: convert `<a>` tag into internalTag | ||
* - external links: add extra attrs | ||
*/ | ||
@@ -114,0 +114,0 @@ declare const linksPlugin: PluginWithOptions<LinksPluginOptions>; |
@@ -403,3 +403,3 @@ var __defProp = Object.defineProperty; | ||
// src/plugins/linksPlugin/linksPlugin.ts | ||
import { isLinkExternal } from "@vuepress/shared"; | ||
import { isLinkExternal, normalizeRoutePath } from "@vuepress/shared"; | ||
@@ -441,3 +441,3 @@ // src/plugins/linksPlugin/resolvePaths.ts | ||
var linksPlugin = (md, options = {}) => { | ||
const internalTag = options.internalTag || "VPLink"; | ||
const internalTag = options.internalTag || "RouteLink"; | ||
const externalAttrs = { | ||
@@ -477,9 +477,15 @@ target: "_blank", | ||
); | ||
const normalizedPath = absolutePath.replace(new RegExp(`^${base}`), "/").replace(/(^|\/)(README|index).md$/i, "$1").replace(/\.md$/, ".html"); | ||
if (["RouterLink", "VPLink"].includes(internalTag)) { | ||
if (["RouterLink", "RouteLink"].includes(internalTag)) { | ||
token.tag = internalTag; | ||
hrefAttr[0] = "to"; | ||
const normalizedPath = normalizeRoutePath( | ||
absolutePath.replace(new RegExp(`^${base}`), "/") | ||
); | ||
hrefAttr[1] = `${normalizedPath}${rawHash}`; | ||
hasOpenInternalLink = true; | ||
} else { | ||
const normalizedPath = normalizeRoutePath(absolutePath); | ||
hrefAttr[1] = `${normalizedPath}${rawHash}`; | ||
} | ||
hrefAttr[1] = `${normalizedPath}${rawHash}`; | ||
; | ||
(env.links ??= []).push({ | ||
@@ -486,0 +492,0 @@ raw: hrefLink, |
{ | ||
"name": "@vuepress/markdown", | ||
"version": "2.0.0-rc.4", | ||
"version": "2.0.0-rc.5", | ||
"description": "Markdown package of VuePress", | ||
@@ -44,4 +44,4 @@ "keywords": [ | ||
"mdurl": "^2.0.0", | ||
"@vuepress/shared": "2.0.0-rc.4", | ||
"@vuepress/utils": "2.0.0-rc.4" | ||
"@vuepress/shared": "2.0.0-rc.5", | ||
"@vuepress/utils": "2.0.0-rc.5" | ||
}, | ||
@@ -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
26350
764
+ Added@types/node@22.8.1(transitive)
+ Added@vuepress/shared@2.0.0-rc.5(transitive)
+ Added@vuepress/utils@2.0.0-rc.5(transitive)
+ Addedora@8.1.0(transitive)
- Removed@types/node@22.8.6(transitive)
- Removed@vuepress/shared@2.0.0-rc.4(transitive)
- Removed@vuepress/utils@2.0.0-rc.4(transitive)
- Removedora@8.1.1(transitive)
Updated@vuepress/shared@2.0.0-rc.5
Updated@vuepress/utils@2.0.0-rc.5