Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vuepress/markdown

Package Overview
Dependencies
Maintainers
2
Versions
183
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-rc.0 to 2.0.0-rc.1

README.md

14

dist/index.d.ts

@@ -14,4 +14,4 @@ import { SfcPluginOptions } from '@mdit-vue/plugin-sfc';

export { default as anchorPlugin } from 'markdown-it-anchor';
import emojiPlugin from 'markdown-it-emoji';
export { default as emojiPlugin } from 'markdown-it-emoji';
import { Options } from 'markdown-it-emoji';
export { full as emojiPlugin } from 'markdown-it-emoji';
export { ComponentPluginOptions, componentPlugin } from '@mdit-vue/plugin-component';

@@ -24,2 +24,6 @@ export { titlePlugin } from '@mdit-vue/plugin-title';

/**
* Whether to prepend base to absolute path
*/
absolutePathPrependBase?: boolean;
/**
* Prefix to add to relative assets links

@@ -52,3 +56,3 @@ */

* - Required for `lineNumbers`
* - Required for language display of default theme
* - Required for title display of default theme
*/

@@ -75,3 +79,3 @@ preWrapper?: boolean;

type EmojiPluginOptions = emojiPlugin.Options;
type EmojiPluginOptions = Options;

@@ -188,2 +192,2 @@ interface ImportCodePluginOptions {

export { AnchorPluginOptions, AssetsPluginOptions, CodePluginOptions, EmojiPluginOptions, ImportCodePluginOptions, LinksPluginOptions, Markdown, MarkdownEnv, MarkdownHeader, MarkdownLink, MarkdownOptions, MarkdownSlugifyFunction, assetsPlugin, codePlugin, createMarkdown, importCodePlugin, linksPlugin };
export { type AnchorPluginOptions, type AssetsPluginOptions, type CodePluginOptions, type EmojiPluginOptions, type ImportCodePluginOptions, type LinksPluginOptions, type Markdown, type MarkdownEnv, type MarkdownHeader, type MarkdownLink, type MarkdownOptions, type MarkdownSlugifyFunction, assetsPlugin, codePlugin, createMarkdown, importCodePlugin, linksPlugin };

@@ -31,3 +31,8 @@ var __defProp = Object.defineProperty;

import { decode } from "mdurl";
var resolveLink = (link, relativePathPrefix, env, strict = false) => {
var resolveLink = (link, {
env,
absolutePathPrependBase = false,
relativePathPrefix,
strict = false
}) => {
if (link.startsWith("data:"))

@@ -49,2 +54,5 @@ return link;

}
if (absolutePathPrependBase && env.base && link.startsWith("/")) {
resolvedLink = path.join(env.base, resolvedLink);
}
return resolvedLink;

@@ -54,3 +62,6 @@ };

// src/plugins/assetsPlugin/assetsPlugin.ts
var assetsPlugin = (md, { relativePathPrefix = "@source" } = {}) => {
var assetsPlugin = (md, {
absolutePathPrependBase = false,
relativePathPrefix = "@source"
} = {}) => {
const rawImageRule = md.renderer.rules.image;

@@ -61,3 +72,6 @@ md.renderer.rules.image = (tokens, idx, options, env, self) => {

if (link) {
token.attrSet("src", resolveLink(link, relativePathPrefix, env));
token.attrSet(
"src",
resolveLink(link, { env, absolutePathPrependBase, relativePathPrefix })
);
}

@@ -69,8 +83,8 @@ return rawImageRule(tokens, idx, options, env, self);

/(<img\b.*?src=)(['"])([^\2]*?)\2/gs,
(_, prefix, quote, src) => `${prefix}${quote}${resolveLink(
src.trim(),
(_, prefix, quote, src) => `${prefix}${quote}${resolveLink(src.trim(), {
env,
absolutePathPrependBase,
relativePathPrefix,
env,
true
)}${quote}`
strict: true
})}${quote}`
).replace(

@@ -81,8 +95,8 @@ /(<img\b.*?srcset=)(['"])([^\2]*?)\2/gs,

/^([^ ]*?)([ \n].*)?$/,
(_2, url, descriptor = "") => `${resolveLink(
url.trim(),
(_2, url, descriptor = "") => `${resolveLink(url.trim(), {
env,
absolutePathPrependBase,
relativePathPrefix,
env,
true
)}${descriptor.replace(/[ \n]+/g, " ").trimEnd()}`
strict: true
})}${descriptor.replace(/[ \n]+/g, " ").trimEnd()}`
)

@@ -99,2 +113,10 @@ ).join(", ")}${quote}`

// src/plugins/codePlugin/resolveAttr.ts
var resolveAttr = (info, attr) => {
const pattern = `\\b${attr}\\s*=\\s*(?<quote>['"])(?<content>.+?)\\k<quote>(\\s|$)`;
const regex = new RegExp(pattern, "i");
const match = info.match(regex);
return match?.groups?.content ?? null;
};
// src/plugins/codePlugin/resolveHighlightLines.ts

@@ -281,3 +303,4 @@ var resolveHighlightLines = (info) => {

}
result = `<div class="${languageClass}${useLineNumbers ? " line-numbers-mode" : ""}" data-ext="${language.ext}">${result}</div>`;
const title = resolveAttr(info, "title") ?? language.ext;
result = `<div class="${languageClass}${useLineNumbers ? " line-numbers-mode" : ""}" data-ext="${language.ext}" data-title="${title}">${result}</div>`;
return result;

@@ -295,3 +318,3 @@ };

// src/plugins/emojiPlugin.ts
import emojiPlugin from "markdown-it-emoji";
import { full as emojiPlugin } from "markdown-it-emoji";

@@ -513,7 +536,6 @@ // src/plugins/importCodePlugin/createImportCodeBlockRule.ts

slugify,
permalink: anchorPlugin.permalink.ariaHidden({
permalink: anchorPlugin.permalink.headerLink({
class: "header-anchor",
symbol: "#",
space: true,
placement: "before"
// Add a span inside the link so Safari shows headings in reader view.
safariReaderFix: true
}),

@@ -520,0 +542,0 @@ ...anchor

{
"name": "@vuepress/markdown",
"version": "2.0.0-rc.0",
"version": "2.0.0-rc.1",
"description": "Markdown package of VuePress",

@@ -11,7 +11,7 @@ "keywords": [

"bugs": {
"url": "https://github.com/vuepress/vuepress-next/issues"
"url": "https://github.com/vuepress/core/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuepress/vuepress-next.git"
"url": "git+https://github.com/vuepress/core.git"
},

@@ -31,18 +31,18 @@ "license": "MIT",

"dependencies": {
"@mdit-vue/plugin-component": "^1.0.0",
"@mdit-vue/plugin-frontmatter": "^1.0.0",
"@mdit-vue/plugin-headers": "^1.0.0",
"@mdit-vue/plugin-sfc": "^1.0.0",
"@mdit-vue/plugin-title": "^1.0.0",
"@mdit-vue/plugin-toc": "^1.0.0",
"@mdit-vue/shared": "^1.0.0",
"@mdit-vue/types": "^1.0.0",
"@types/markdown-it": "^13.0.6",
"@mdit-vue/plugin-component": "^2.0.0",
"@mdit-vue/plugin-frontmatter": "^2.0.0",
"@mdit-vue/plugin-headers": "^2.0.0",
"@mdit-vue/plugin-sfc": "^2.0.0",
"@mdit-vue/plugin-title": "^2.0.0",
"@mdit-vue/plugin-toc": "^2.0.0",
"@mdit-vue/shared": "^2.0.0",
"@mdit-vue/types": "^2.0.0",
"@types/markdown-it": "^13.0.7",
"@types/markdown-it-emoji": "^2.0.4",
"markdown-it": "^13.0.2",
"markdown-it": "^14.0.0",
"markdown-it-anchor": "^8.6.7",
"markdown-it-emoji": "^2.0.2",
"mdurl": "^1.0.1",
"@vuepress/shared": "2.0.0-rc.0",
"@vuepress/utils": "2.0.0-rc.0"
"markdown-it-emoji": "^3.0.0",
"mdurl": "^2.0.0",
"@vuepress/shared": "2.0.0-rc.1",
"@vuepress/utils": "2.0.0-rc.1"
},

@@ -67,3 +67,3 @@ "devDependencies": {

"target": "es2022",
"tsconfig": "../tsconfig.dts.json"
"tsconfig": "../../tsconfig.dts.json"
},

@@ -70,0 +70,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

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