@vuepress/markdown
Advanced tools
Comparing version 2.0.0-beta.46 to 2.0.0-beta.47
@@ -5,2 +5,2 @@ import type { Markdown, MarkdownOptions } from './types'; | ||
*/ | ||
export declare const createMarkdown: ({ anchor, assets, code, customComponent, emoji, extractHeaders, extractTitle, hoistTags, importCode, links, toc, ...markdownItOptions }?: MarkdownOptions) => Markdown; | ||
export declare const createMarkdown: ({ anchor, assets, code, customComponent, emoji, extractHeaders, extractTitle, hoistTags, importCode, links, slugify, toc, ...markdownItOptions }?: MarkdownOptions) => Markdown; |
@@ -10,3 +10,3 @@ "use strict"; | ||
*/ | ||
const createMarkdown = ({ anchor, assets, code, customComponent, emoji, extractHeaders, extractTitle, hoistTags, importCode, links, toc, ...markdownItOptions } = {}) => { | ||
const createMarkdown = ({ anchor, assets, code, customComponent, emoji, extractHeaders, extractTitle, hoistTags, importCode, links, slugify = utils_1.vuepressSlugify, toc, ...markdownItOptions } = {}) => { | ||
// create raw markdown-it instance | ||
@@ -29,3 +29,3 @@ const md = MarkdownIt({ | ||
level: [1, 2, 3, 4, 5, 6], | ||
slugify: utils_1.slugify, | ||
slugify, | ||
permalink: plugins_1.anchorPlugin.permalink.ariaHidden({ | ||
@@ -44,3 +44,3 @@ class: 'header-anchor', | ||
level: [2, 3], | ||
slugify: utils_1.slugify, | ||
slugify, | ||
linkTag: 'RouterLink', | ||
@@ -54,3 +54,3 @@ ...toc, | ||
level: [2, 3], | ||
slugify: utils_1.slugify, | ||
slugify, | ||
...extractHeaders, | ||
@@ -57,0 +57,0 @@ }); |
import type { PluginWithOptions } from 'markdown-it'; | ||
import type { MarkdownSlugifyFunction } from '../types'; | ||
export interface ExtractHeadersPluginOptions { | ||
@@ -16,3 +17,3 @@ /** | ||
*/ | ||
slugify?: (str: string) => string; | ||
slugify?: MarkdownSlugifyFunction; | ||
/** | ||
@@ -19,0 +20,0 @@ * A function for formatting headers |
@@ -10,3 +10,3 @@ "use strict"; | ||
*/ | ||
const extractHeadersPlugin = (md, { level = [2, 3], slugify = utils_1.slugify, format, } = {}) => { | ||
const extractHeadersPlugin = (md, { level = [2, 3], slugify = utils_1.vuepressSlugify, format, } = {}) => { | ||
let headers; | ||
@@ -13,0 +13,0 @@ // push the rule to the end of the chain |
import type { PluginWithOptions } from 'markdown-it'; | ||
import type { MarkdownSlugifyFunction } from '../../types'; | ||
export interface TocPluginOptions { | ||
@@ -13,3 +14,3 @@ /** | ||
*/ | ||
slugify?: (str: string) => string; | ||
slugify?: MarkdownSlugifyFunction; | ||
/** | ||
@@ -16,0 +17,0 @@ * A function for formatting headers |
@@ -18,3 +18,3 @@ "use strict"; | ||
*/ | ||
const tocPlugin = (md, { pattern = /^\[\[toc\]\]$/i, slugify = utils_1.slugify, format, level = [2, 3], containerTag = 'nav', containerClass = 'table-of-contents', listTag = 'ul', listClass = '', itemClass = '', linkTag = 'a', linkClass = '', } = {}) => { | ||
const tocPlugin = (md, { pattern = /^\[\[toc\]\]$/i, slugify = utils_1.vuepressSlugify, format, level = [2, 3], containerTag = 'nav', containerClass = 'table-of-contents', listTag = 'ul', listClass = '', itemClass = '', linkTag = 'a', linkClass = '', } = {}) => { | ||
let headers; | ||
@@ -21,0 +21,0 @@ // push the rule to the end of the chain |
@@ -16,2 +16,3 @@ import type { PageFrontmatter, PageHeader } from '@vuepress/shared'; | ||
links?: false | LinksPluginOptions; | ||
slugify?: MarkdownSlugifyFunction; | ||
toc?: false | TocPluginOptions; | ||
@@ -78,1 +79,5 @@ } | ||
} | ||
/** | ||
* Type of `slugify` function | ||
*/ | ||
export declare type MarkdownSlugifyFunction = (str: string) => string; |
export * from './resolveHeadersFromTokens'; | ||
export * from './resolveTitleFromToken'; | ||
export * from './slugify'; | ||
export * from './vuepressSlugify'; |
@@ -19,2 +19,2 @@ "use strict"; | ||
__exportStar(require("./resolveTitleFromToken"), exports); | ||
__exportStar(require("./slugify"), exports); | ||
__exportStar(require("./vuepressSlugify"), exports); |
{ | ||
"name": "@vuepress/markdown", | ||
"version": "2.0.0-beta.46", | ||
"version": "2.0.0-beta.47", | ||
"description": "Markdown package of VuePress", | ||
@@ -26,4 +26,4 @@ "keywords": [ | ||
"@types/markdown-it": "^12.2.3", | ||
"@vuepress/shared": "2.0.0-beta.46", | ||
"@vuepress/utils": "2.0.0-beta.46", | ||
"@vuepress/shared": "2.0.0-beta.47", | ||
"@vuepress/utils": "2.0.0-beta.47", | ||
"markdown-it": "^13.0.1", | ||
@@ -30,0 +30,0 @@ "markdown-it-anchor": "^8.6.4", |
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
74005
1999
+ Added@vuepress/shared@2.0.0-beta.47(transitive)
+ Added@vuepress/utils@2.0.0-beta.47(transitive)
- Removed@vuepress/shared@2.0.0-beta.46(transitive)
- Removed@vuepress/utils@2.0.0-beta.46(transitive)