Socket
Socket
Sign inDemoInstall

@vuepress/markdown

Package Overview
Dependencies
Maintainers
7
Versions
180
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vuepress/markdown - npm Package Compare versions

Comparing version 2.0.0-beta.13 to 2.0.0-beta.15

11

CHANGELOG.md

@@ -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 @@

16

lib/plugins/assetsPlugin.js
"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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc