@vuepress/markdown
Advanced tools
Comparing version 2.0.0-beta.13 to 2.0.0-beta.15
@@ -6,2 +6,13 @@ # Change Log | ||
# [2.0.0-beta.15](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.14...v2.0.0-beta.15) (2021-05-27) | ||
### Bug Fixes | ||
* **markdown:** decode assets link to ensure bundler can find the file ([#144](https://github.com/vuepress/vuepress-next/issues/144)) ([d3e5409](https://github.com/vuepress/vuepress-next/commit/d3e5409246a47edae93209c9ce5dd2614e14c936)) | ||
# [2.0.0-beta.13](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.12...v2.0.0-beta.13) (2021-05-06) | ||
@@ -8,0 +19,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.assetsPlugin = void 0; | ||
const mdurl_1 = require("mdurl"); | ||
const utils_1 = require("@vuepress/utils"); | ||
@@ -14,9 +15,14 @@ /** | ||
const link = token.attrGet('src'); | ||
if (!link) { | ||
return rawRule(tokens, idx, options, env, self); | ||
} | ||
// decode link to ensure bundler can find the file correctly | ||
let resolvedLink = mdurl_1.decode(link); | ||
// if the link is relative path, and the `env.filePathRelative` exists | ||
if (link && /^\.{1,2}\//.test(link) && env.filePathRelative) { | ||
// add `@source` alias to the link | ||
const resolvedLink = `${relativePathPrefix}/${utils_1.path.join(utils_1.path.dirname(env.filePathRelative), link)}`; | ||
// replace the original link with absolute path | ||
token.attrSet('src', resolvedLink); | ||
// add `@source` alias to the link | ||
if (/^\.{1,2}\//.test(link) && env.filePathRelative) { | ||
resolvedLink = `${relativePathPrefix}/${utils_1.path.join(utils_1.path.dirname(env.filePathRelative), resolvedLink)}`; | ||
} | ||
// replace the original link with resolved link | ||
token.attrSet('src', resolvedLink); | ||
return rawRule(tokens, idx, options, env, self); | ||
@@ -23,0 +29,0 @@ }; |
{ | ||
"name": "@vuepress/markdown", | ||
"version": "2.0.0-beta.13", | ||
"version": "2.0.0-beta.15", | ||
"description": "Markdown package of VuePress", | ||
@@ -31,6 +31,7 @@ "keywords": [ | ||
"@vuepress/shared": "2.0.0-beta.7", | ||
"@vuepress/utils": "2.0.0-beta.11", | ||
"@vuepress/utils": "2.0.0-beta.15", | ||
"markdown-it": "^12.0.6", | ||
"markdown-it-anchor": "^7.1.0", | ||
"markdown-it-emoji": "^2.0.0" | ||
"markdown-it-emoji": "^2.0.0", | ||
"mdurl": "^1.0.1" | ||
}, | ||
@@ -40,3 +41,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "1e20c489ef2d1418d7da5c22847e05c516ba62a2" | ||
"gitHead": "b796eac6cc6379c996ac576e10d5bf46e33cfb99" | ||
} |
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
78771
1886
7
+ Addedmdurl@^1.0.1
+ Added@vuepress/utils@2.0.0-beta.15(transitive)
+ Addedfs-extra@10.1.0(transitive)
- Removed@vuepress/utils@2.0.0-beta.11(transitive)
- Removedat-least-node@1.0.0(transitive)
- Removedfs-extra@9.1.0(transitive)