mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-28 19:48:49 +01:00
Introduce options.markdownItFactory (and remove options.markdownItPlugins) so the markdown-it parser can be removed as a direct dependency because it is no longer used by default.
This commit is contained in:
parent
3cbe1cb6c5
commit
d4b981bcb3
11 changed files with 172 additions and 67 deletions
|
|
@ -357,6 +357,23 @@ export type Rule = {
|
|||
*/
|
||||
function: RuleFunction;
|
||||
};
|
||||
/**
|
||||
* Method used by the markdown-it parser to parse input.
|
||||
*/
|
||||
export type MarkdownItParse = (src: string, env: any) => any[];
|
||||
/**
|
||||
* Instance of the markdown-it parser.
|
||||
*/
|
||||
export type MarkdownIt = {
|
||||
/**
|
||||
* Method to parse input.
|
||||
*/
|
||||
parse: MarkdownItParse;
|
||||
};
|
||||
/**
|
||||
* Gets an instance of the markdown-it parser. Any plugins should already have been loaded.
|
||||
*/
|
||||
export type MarkdownItFactory = () => MarkdownIt;
|
||||
/**
|
||||
* Configuration options.
|
||||
*/
|
||||
|
|
@ -390,9 +407,9 @@ export type Options = {
|
|||
*/
|
||||
handleRuleFailures?: boolean;
|
||||
/**
|
||||
* Additional plugins.
|
||||
* Function to create a markdown-it parser.
|
||||
*/
|
||||
markdownItPlugins?: Plugin[];
|
||||
markdownItFactory?: MarkdownItFactory;
|
||||
/**
|
||||
* True to ignore HTML directives.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue