@vuepress/markdown 2.0.0-rc.2 → 2.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -87,9 +87,9 @@ interface LinksPluginOptions {
|
|
|
87
87
|
/**
|
|
88
88
|
* Tag for internal links
|
|
89
89
|
*
|
|
90
|
-
* @default '
|
|
90
|
+
* @default 'VPLink'
|
|
91
91
|
*/
|
|
92
|
-
internalTag?: 'a' | 'RouterLink';
|
|
92
|
+
internalTag?: 'a' | 'VPLink' | 'RouterLink';
|
|
93
93
|
/**
|
|
94
94
|
* Additional attributes for external links
|
|
95
95
|
*
|
|
@@ -106,7 +106,7 @@ interface LinksPluginOptions {
|
|
|
106
106
|
/**
|
|
107
107
|
* Process links in markdown file
|
|
108
108
|
*
|
|
109
|
-
* - internal links: convert them into `<
|
|
109
|
+
* - internal links: convert them into `<VPLink>`
|
|
110
110
|
* - external links: add extra attrs and external icon
|
|
111
111
|
*/
|
|
112
112
|
declare const linksPlugin: PluginWithOptions<LinksPluginOptions>;
|
package/dist/index.js
CHANGED
|
@@ -437,7 +437,7 @@ var resolvePaths = (rawPath, base, filePathRelative) => {
|
|
|
437
437
|
|
|
438
438
|
// src/plugins/linksPlugin/linksPlugin.ts
|
|
439
439
|
var linksPlugin = (md, options = {}) => {
|
|
440
|
-
const internalTag = options.internalTag || "
|
|
440
|
+
const internalTag = options.internalTag || "VPLink";
|
|
441
441
|
const externalAttrs = {
|
|
442
442
|
target: "_blank",
|
|
443
443
|
rel: "noopener noreferrer",
|
|
@@ -473,7 +473,7 @@ var linksPlugin = (md, options = {}) => {
|
|
|
473
473
|
filePathRelative
|
|
474
474
|
);
|
|
475
475
|
const normalizedPath = absolutePath.replace(new RegExp(`^${base}`), "/").replace(/(^|\/)(README|index).md$/i, "$1").replace(/\.md$/, ".html");
|
|
476
|
-
if (
|
|
476
|
+
if (["RouterLink", "VPLink"].includes(internalTag)) {
|
|
477
477
|
token.tag = internalTag;
|
|
478
478
|
hrefAttr[0] = "to";
|
|
479
479
|
hasOpenInternalLink = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/markdown",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.4",
|
|
4
4
|
"description": "Markdown package of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"markdown-it-anchor": "^8.6.7",
|
|
42
42
|
"markdown-it-emoji": "^3.0.0",
|
|
43
43
|
"mdurl": "^2.0.0",
|
|
44
|
-
"@vuepress/shared": "2.0.0-rc.
|
|
45
|
-
"@vuepress/utils": "2.0.0-rc.
|
|
44
|
+
"@vuepress/shared": "2.0.0-rc.4",
|
|
45
|
+
"@vuepress/utils": "2.0.0-rc.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/mdurl": "^1.0.5"
|