@vuepress/markdown
Advanced tools
Comparing version 2.0.0-beta.25 to 2.0.0-beta.27
@@ -1,4 +0,3 @@ | ||
import * as anchorPlugin from 'markdown-it-anchor'; | ||
import type { AnchorOptions } from 'markdown-it-anchor'; | ||
export declare type AnchorPluginOptions = AnchorOptions; | ||
import anchorPlugin from 'markdown-it-anchor'; | ||
export declare type AnchorPluginOptions = anchorPlugin.AnchorOptions; | ||
export { anchorPlugin }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.anchorPlugin = void 0; | ||
const anchorPlugin = require("markdown-it-anchor"); | ||
exports.anchorPlugin = anchorPlugin; | ||
const markdown_it_anchor_1 = require("markdown-it-anchor"); | ||
exports.anchorPlugin = markdown_it_anchor_1.default; |
@@ -17,3 +17,3 @@ "use strict"; | ||
// replace the original link with resolved link | ||
token.attrSet('src', resolveLink_1.resolveLink(link, relativePathPrefix, env)); | ||
token.attrSet('src', (0, resolveLink_1.resolveLink)(link, relativePathPrefix, env)); | ||
} | ||
@@ -25,3 +25,3 @@ return rawImageRule(tokens, idx, options, env, self); | ||
// replace the original link with resolved link | ||
tokens[idx].content = tokens[idx].content.replace(/^( *<img\b.*src=")([^"]*)(")/s, (_, prefix, link, suffix) => `${prefix}${resolveLink_1.resolveLink(link, relativePathPrefix, env)}${suffix}`); | ||
tokens[idx].content = tokens[idx].content.replace(/^( *<img\b.*src=")([^"]*)(")/s, (_, prefix, link, suffix) => `${prefix}${(0, resolveLink_1.resolveLink)(link, relativePathPrefix, env)}${suffix}`); | ||
return rawHtmlRule(tokens, idx, options, env, self); | ||
@@ -28,0 +28,0 @@ }; |
@@ -8,3 +8,3 @@ "use strict"; | ||
// decode link to ensure bundler can find the file correctly | ||
let resolvedLink = mdurl_1.decode(link); | ||
let resolvedLink = (0, mdurl_1.decode)(link); | ||
// if the link is relative path, and the `env.filePathRelative` exists | ||
@@ -11,0 +11,0 @@ // add `@source` alias to the link |
@@ -19,3 +19,3 @@ "use strict"; | ||
// resolve language from token info | ||
const language = resolveLanguage_1.resolveLanguage(info); | ||
const language = (0, resolveLanguage_1.resolveLanguage)(info); | ||
const languageClass = `${options.langPrefix}${language.name}`; | ||
@@ -30,3 +30,3 @@ // try to get highlighted code | ||
// resolve v-pre mark from token info | ||
const useVPre = (_b = resolveVPre_1.resolveVPre(info)) !== null && _b !== void 0 ? _b : vPre; | ||
const useVPre = (_b = (0, resolveVPre_1.resolveVPre)(info)) !== null && _b !== void 0 ? _b : vPre; | ||
if (useVPre) { | ||
@@ -43,3 +43,3 @@ result = `<pre v-pre${result.slice('<pre'.length)}`; | ||
const highlightLinesRanges = highlightLines | ||
? resolveHighlightLines_1.resolveHighlightLines(info) | ||
? (0, resolveHighlightLines_1.resolveHighlightLines)(info) | ||
: null; | ||
@@ -50,3 +50,3 @@ // generate highlight lines | ||
.map((_, index) => { | ||
if (resolveHighlightLines_1.isHighlightLine(index + 1, highlightLinesRanges)) { | ||
if ((0, resolveHighlightLines_1.isHighlightLine)(index + 1, highlightLinesRanges)) { | ||
return '<div class="highlight-line"> </div>'; | ||
@@ -60,3 +60,3 @@ } | ||
// resolve line-numbers mark from token info | ||
const useLineNumbers = (_c = resolveLineNumbers_1.resolveLineNumbers(info)) !== null && _c !== void 0 ? _c : (typeof lineNumbers === 'number' | ||
const useLineNumbers = (_c = (0, resolveLineNumbers_1.resolveLineNumbers)(info)) !== null && _c !== void 0 ? _c : (typeof lineNumbers === 'number' | ||
? lines.length >= lineNumbers | ||
@@ -63,0 +63,0 @@ : lineNumbers); |
@@ -15,3 +15,3 @@ "use strict"; | ||
md.core.ruler.push('resolveExtractHeaders', (state) => { | ||
headers = utils_1.resolveHeadersFromTokens(state.tokens, { | ||
headers = (0, utils_1.resolveHeadersFromTokens)(state.tokens, { | ||
level, | ||
@@ -18,0 +18,0 @@ allowHtml: false, |
@@ -15,3 +15,3 @@ "use strict"; | ||
if (tokenIdx > -1) { | ||
title = utils_1.resolveTitleFromToken(state.tokens[tokenIdx + 1], { | ||
title = (0, utils_1.resolveTitleFromToken)(state.tokens[tokenIdx + 1], { | ||
escapeText: false, | ||
@@ -18,0 +18,0 @@ allowHtml: false, |
@@ -8,3 +8,3 @@ "use strict"; | ||
// add import_code block rule | ||
md.block.ruler.before('fence', 'import_code', createImportCodeBlockRule_1.createImportCodeBlockRule(options), { | ||
md.block.ruler.before('fence', 'import_code', (0, createImportCodeBlockRule_1.createImportCodeBlockRule)(options), { | ||
alt: ['paragraph', 'reference', 'blockquote', 'list'], | ||
@@ -16,3 +16,3 @@ }); | ||
// use imported code as token content | ||
const { importFilePath, importCode } = resolveImportCode_1.resolveImportCode(token.meta, env); | ||
const { importFilePath, importCode } = (0, resolveImportCode_1.resolveImportCode)(token.meta, env); | ||
token.content = importCode; | ||
@@ -19,0 +19,0 @@ // extract imported files to env |
@@ -43,3 +43,3 @@ "use strict"; | ||
// check if a link is an external link | ||
if (shared_1.isLinkExternal(hrefLink, base)) { | ||
if ((0, shared_1.isLinkExternal)(hrefLink, base)) { | ||
// set `externalAttrs` to current token | ||
@@ -69,3 +69,3 @@ Object.entries(externalAttrs).forEach(([key, val]) => token.attrSet(key, val)); | ||
// resolve relative and absolute path | ||
const { relativePath, absolutePath } = resolvePaths_1.resolvePaths(rawPath, base, filePathRelative); | ||
const { relativePath, absolutePath } = (0, resolvePaths_1.resolvePaths)(rawPath, base, filePathRelative); | ||
// normalize markdown file path to route path | ||
@@ -72,0 +72,0 @@ // |
@@ -6,8 +6,8 @@ "use strict"; | ||
const createRenderHeaders = ({ listTag, listClass, itemClass, linkTag, linkClass, }) => { | ||
const listTagString = shared_1.htmlEscape(listTag); | ||
const listClassString = listClass ? ` class="${shared_1.htmlEscape(listClass)}"` : ''; | ||
const listTagString = (0, shared_1.htmlEscape)(listTag); | ||
const listClassString = listClass ? ` class="${(0, shared_1.htmlEscape)(listClass)}"` : ''; | ||
const itemTagString = 'li'; | ||
const itemClassString = itemClass ? ` class="${shared_1.htmlEscape(itemClass)}"` : ''; | ||
const linkTagString = shared_1.htmlEscape(linkTag); | ||
const linkClassString = linkClass ? ` class="${shared_1.htmlEscape(linkClass)}` : ''; | ||
const itemClassString = itemClass ? ` class="${(0, shared_1.htmlEscape)(itemClass)}"` : ''; | ||
const linkTagString = (0, shared_1.htmlEscape)(linkTag); | ||
const linkClassString = linkClass ? ` class="${(0, shared_1.htmlEscape)(linkClass)}` : ''; | ||
const linkTo = (slug) => linkTag === 'RouterLink' ? ` to="#${slug}"` : ` href="#${slug}"`; | ||
@@ -14,0 +14,0 @@ const renderHeaders = (headers) => `\ |
@@ -23,3 +23,3 @@ "use strict"; | ||
md.core.ruler.push('resolveTocHeaders', (state) => { | ||
headers = utils_1.resolveHeadersFromTokens(state.tokens, { | ||
headers = (0, utils_1.resolveHeadersFromTokens)(state.tokens, { | ||
level, | ||
@@ -34,3 +34,3 @@ allowHtml: true, | ||
// add toc syntax as a block rule | ||
md.block.ruler.before('heading', 'toc', createTocBlockRule_1.createTocBlockRule({ | ||
md.block.ruler.before('heading', 'toc', (0, createTocBlockRule_1.createTocBlockRule)({ | ||
pattern, | ||
@@ -42,3 +42,3 @@ containerTag, | ||
}); | ||
const renderHeaders = createRenderHeaders_1.createRenderHeaders({ | ||
const renderHeaders = (0, createRenderHeaders_1.createRenderHeaders)({ | ||
listTag, | ||
@@ -45,0 +45,0 @@ listClass, |
import type { PageFrontmatter, PageHeader } from '@vuepress/shared'; | ||
import * as MarkdownIt from 'markdown-it'; | ||
import type * as MarkdownIt from 'markdown-it'; | ||
import type { AnchorPluginOptions, AssetsPluginOptions, CodePluginOptions, EmojiPluginOptions, ExtractHeadersPluginOptions, HoistTagsPluginOptions, ImportCodePluginOptions, LinksPluginOptions, TocPluginOptions } from './plugins'; | ||
@@ -4,0 +4,0 @@ export declare type Markdown = MarkdownIt; |
@@ -1,2 +0,2 @@ | ||
import * as Token from 'markdown-it/lib/token'; | ||
import type * as Token from 'markdown-it/lib/token'; | ||
import type { MarkdownHeader } from '../types'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -47,3 +47,3 @@ "use strict"; | ||
} | ||
const title = resolveTitleFromToken_1.resolveTitleFromToken(nextToken, { | ||
const title = (0, resolveTitleFromToken_1.resolveTitleFromToken)(nextToken, { | ||
allowHtml, | ||
@@ -58,3 +58,3 @@ escapeText, | ||
level: headerLevel, | ||
title: shared_1.isFunction(format) ? format(title) : title, | ||
title: (0, shared_1.isFunction)(format) ? format(title) : title, | ||
slug, | ||
@@ -61,0 +61,0 @@ children: [], |
@@ -1,2 +0,2 @@ | ||
import * as Token from 'markdown-it/lib/token'; | ||
import type * as Token from 'markdown-it/lib/token'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Resolve header title from markdown-it token |
@@ -33,3 +33,3 @@ "use strict"; | ||
if (item.type === 'code_inline' || item.type === 'text') { | ||
return `${result}${shared_1.htmlEscape(item.content)}`; | ||
return `${result}${(0, shared_1.htmlEscape)(item.content)}`; | ||
} | ||
@@ -36,0 +36,0 @@ } |
{ | ||
"name": "@vuepress/markdown", | ||
"version": "2.0.0-beta.25", | ||
"version": "2.0.0-beta.27", | ||
"description": "Markdown package of VuePress", | ||
@@ -29,7 +29,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@types/markdown-it": "^12.2.0", | ||
"@vuepress/shared": "2.0.0-beta.25", | ||
"@vuepress/utils": "2.0.0-beta.25", | ||
"@types/markdown-it": "^12.2.3", | ||
"@vuepress/shared": "2.0.0-beta.27", | ||
"@vuepress/utils": "2.0.0-beta.27", | ||
"markdown-it": "^12.2.0", | ||
"markdown-it-anchor": "^8.1.2", | ||
"markdown-it-anchor": "^8.4.1", | ||
"markdown-it-emoji": "^2.0.0", | ||
@@ -41,3 +41,3 @@ "mdurl": "^1.0.1" | ||
}, | ||
"gitHead": "76ce5e52b07de75cf1f40a57ef3b6a682e44fce7" | ||
"gitHead": "2671a94fe6864e215eb84f318b7e657744a0bc5d" | ||
} |
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
72323
1945
+ Added@vuepress/shared@2.0.0-beta.27(transitive)
+ Added@vuepress/utils@2.0.0-beta.27(transitive)
- Removed@vuepress/shared@2.0.0-beta.25(transitive)
- Removed@vuepress/utils@2.0.0-beta.25(transitive)
Updated@types/markdown-it@^12.2.3
Updatedmarkdown-it-anchor@^8.4.1