import * as ast from "../../ast/index.js"; import * as files from "../../filesystem/index.js"; export type MarkdownItAst = MarkdownItNode[]; export interface MarkdownItNode { /** HTML attributes. Format: `[[name1, value1], [name2, value2]]` */ readonly attrs: [string, string][] | null; /** An array of child nodes (inline and img tokens) */ readonly children: MarkdownItNode[] | null; /** In a case of self-closing tag (code, html, fence, etc.), it has contents of this tag. */ readonly content: string; /** Source map info. Format: `[line_begin, line_end]` */ readonly map: [number, number] | null; /** HTML tag name, e.g. "p" */ readonly tag: string; /** Type of the token, e.g. "paragraph_open" */ readonly type: string; } export type MarkdownItNodeAttrs = string[][]; /** MarkdownParser parses Markdown. */ export declare class MarkdownParser { private readonly closingTagParser; /** parses HTML snippets into ast.NodeLists */ private readonly htmlParser; /** MarkdownIt instance */ private readonly markdownIt; /** helps map Markdown to HTML node types */ private readonly tagMapper; constructor(); /** returns the standard AST representing the given Markdown text */ parse(text: string, sourceDir: files.SourceDir, file: files.FullFilePath): ast.NodeList; /** Converts the given MarkdownIt AST into the standard AST format */ private standardizeAST; private standardizeClosingHTMLTag; private standardizeClosingNode; private standardizeCodeInline; private standardizeEmbeddedCodeblock; private standardizeFence; private standardizeHeadingClose; private standardizeHeadingOpen; private standardizeHTMLBlock; private standardizeImageNode; /** Returns the standardized version of the given MarkdownIt node */ private standardizeNode; private standardizeOpeningNode; private standardizeTextNode; private standizeStandaloneTag; } /** returns the given attributes from a MarkdownIt node in the standard AST format */ export declare function standardizeMarkdownItAttributes(attrs: MarkdownItNodeAttrs | null): ast.NodeAttributes; //# sourceMappingURL=md-parser.d.ts.map