mathpix-markdown-it
Version:
Mathpix-markdown-it is an open source implementation of the mathpix-markdown spec written in Typescript. It relies on the following open source libraries: MathJax v3 (to render math with SVGs), markdown-it (for standard Markdown parsing)
16 lines (15 loc) • 915 B
TypeScript
/** Called from init_math_cache hook at the start of every md.parse(). */
export declare const initMathCache: (state: any) => void;
/** Called from cleanup_math_cache hook at the end of every md.parse().
* The cache is for within-parse dedup only; after parse it's dead weight
* on env (holds MathJax html/svg strings for every unique expression). */
export declare const cleanupMathCache: (state: any) => void;
/** Begin a section where cache must not be used (options.outMath is temporarily mutated). */
export declare const beginCacheBypass: (state: any) => void;
/** End a cache-bypass section. */
export declare const endCacheBypass: (state: any) => void;
/**
* Converts a math token into HTML and attaches MathJax metadata to the token.
* Also extracts equation labels and stores them in the shared labels list.
*/
export declare const convertMathToHtml: (state: any, token: any, options: any) => any;