@f-fjs/tidy-markdown
Version:
Fix ugly markdown.
23 lines (22 loc) • 1.29 kB
TypeScript
import treeAdapter from './tree-adapter';
export declare function isElement(val?: treeAdapter.Node | null): val is treeAdapter.Element;
export declare function isParentNode(val?: treeAdapter.Node | null): val is treeAdapter.ParentNode;
export declare function assertIsElement(val?: treeAdapter.Node | null): asserts val is treeAdapter.Element;
/**
* Wrap code with delimiters
* @param {String} code
* @param {String} delimiter The delimiter to start with, additional backticks
* will be added if needed; like if the code contains a sequence of backticks
* that would end the code block prematurely.
*/
export declare function delimitCode(code: string, delimiter: string): string;
export declare function getAttribute(node: treeAdapter.Node, attribute: string): string | null;
/**
* Check if node has more attributes than ones provided
* @return {boolean} true if no extra attributes otherwise false
*/
export declare function noExtraAttributes(node: treeAdapter.Node, ...attributes: string[]): boolean;
export declare function cleanText(node: treeAdapter.Node): any;
export declare function decodeHtmlEntities(text: string): any;
export declare function isBlock(node: treeAdapter.Node): boolean;
export declare function isVoid(node: treeAdapter.Node): boolean;