UNPKG

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)

56 lines (55 loc) 2.42 kB
export type TParselines = { cLines: Array<Array<string>>; cSpaces: Array<Array<string>>; sLines: Array<string>; }; export declare const getContent: (content: string, onlyOne?: boolean, skipTrim?: boolean) => string; export declare const generateUniqueId: (onlyUuid?: boolean) => string; export declare const getColumnLines: (str: string, numCol?: number) => Array<string>; export declare const getColumnAlign: (align: string) => string[] | [ ]; export type TAlignData = { cAlign: Array<string>; vAlign: Array<string>; cWidth: Array<string>; colSpec: Array<string>; }; export type TVerticalPos = 't' | 'c' | 'b'; export type TTdMeta = { parentBracket?: TVerticalPos; multi?: any; colCount?: number; colSpecs?: string[]; currentColIndex?: number; isSubTabular?: boolean; forceMultiFixedWidth?: boolean; }; export declare const parseTabularPos: (raw: string | undefined | null) => TVerticalPos | undefined; export declare const normalizeDefaultCellVerticalAlign: (value: string | undefined | null) => TVerticalPos | undefined; export declare const bracketToVAlign: (bracket: TVerticalPos | undefined) => string; export declare const getVerticallyColumnAlign: (align: string, numCol: number, bracketDefault?: TVerticalPos) => TAlignData; export declare const getParams: (str: string, i: number) => { align: string; index: number; bracket: TVerticalPos; }; export type TDecimal = { l: number; r: number; }; export declare const getDecimal: (cAlign: Array<string>, cellsAll: Array<string>) => Array<TDecimal>; export declare const getCellsAll: (rows: string[]) => string[]; export declare const getRowLines: (rows: string[], numCol: number) => TParselines; /** * Checks whether any column listed in `colsToFixWidth` uses an unsafe spec in `colSpec`. * Used to decide if tabular column specs must be rewritten to fixed-width paragraph columns. * * @param colsToFixWidth - Column indices that require fixed width (e.g., columns containing lists) * @param colSpec - Original column specs array (e.g., ["l","c","p{...}"]) */ export declare const shouldRewriteColSpec: (colsToFixWidth: number[] | undefined, colSpec: string[] | undefined) => boolean; /** * Detects whether the given content starts a block-level LaTeX construct * (e.g. list environments like \begin{itemize}). */ export declare const detectLocalBlock: (content: string) => boolean;