@vuepress/markdown 2.0.0-beta.43 → 2.0.0-beta.44
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.
|
@@ -60,7 +60,7 @@ const codePlugin = (md, { highlightLines = true, lineNumbers = true, preWrapper
|
|
|
60
60
|
if (useLineNumbers) {
|
|
61
61
|
// generate line numbers code
|
|
62
62
|
const lineNumbersCode = lines
|
|
63
|
-
.map((
|
|
63
|
+
.map(() => `<div class="line-number"></div>`)
|
|
64
64
|
.join('');
|
|
65
65
|
result = `${result}<div class="line-numbers" aria-hidden="true">${lineNumbersCode}</div>`;
|
|
66
66
|
}
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolvePaths = void 0;
|
|
4
|
+
const shared_1 = require("@vuepress/shared");
|
|
4
5
|
const utils_1 = require("@vuepress/utils");
|
|
5
6
|
/**
|
|
6
7
|
* Resolve relative and absolute paths according to the `base` and `filePathRelative`
|
|
7
8
|
*/
|
|
8
9
|
const resolvePaths = (rawPath, base, filePathRelative) => {
|
|
9
|
-
let relativePath;
|
|
10
10
|
let absolutePath;
|
|
11
|
+
let relativePath;
|
|
11
12
|
if (rawPath.startsWith('/')) {
|
|
12
13
|
// if raw path is absolute
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
if (rawPath.endsWith('.md')) {
|
|
15
|
+
// if raw path is a link to markdown file
|
|
16
|
+
// prepend `base` to the link
|
|
17
|
+
absolutePath = utils_1.path.join(base, rawPath);
|
|
18
|
+
relativePath = (0, shared_1.removeLeadingSlash)(rawPath);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
// if raw path is a link to other kind of file
|
|
22
|
+
// keep the link as is
|
|
23
|
+
absolutePath = rawPath;
|
|
24
|
+
relativePath = utils_1.path.relative(base, absolutePath);
|
|
25
|
+
}
|
|
15
26
|
}
|
|
16
27
|
else {
|
|
17
28
|
// if raw path is relative
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/markdown",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.44",
|
|
4
4
|
"description": "Markdown package of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@types/markdown-it": "^12.2.3",
|
|
26
|
-
"@vuepress/shared": "2.0.0-beta.
|
|
27
|
-
"@vuepress/utils": "2.0.0-beta.
|
|
28
|
-
"markdown-it": "^13.0.
|
|
29
|
-
"markdown-it-anchor": "^8.
|
|
30
|
-
"markdown-it-emoji": "^2.0.
|
|
26
|
+
"@vuepress/shared": "2.0.0-beta.44",
|
|
27
|
+
"@vuepress/utils": "2.0.0-beta.44",
|
|
28
|
+
"markdown-it": "^13.0.1",
|
|
29
|
+
"markdown-it-anchor": "^8.6.3",
|
|
30
|
+
"markdown-it-emoji": "^2.0.2",
|
|
31
31
|
"mdurl": "^1.0.1"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|