/** * Markdown scanner: finds fenced PlantUML code blocks and already rendered * excaliplant regions. A single linear pass over the lines; nothing here uses * backtracking regexes on document-sized input. * @module markdown/scan */ /** Info-string languages that denote PlantUML. */ export declare const PLANTUML_LANGS: readonly string[]; export type FenceAttrs = { theme?: string; clean?: boolean; seed?: string; width?: number; alt?: string; /** * Relative path to a PlantUML source file for document rendering. */ src?: string; }; export type FenceBlock = { kind: "fence"; /** * Lower-cased language (`plantuml`, `puml` or `uml`). */ lang: string; /** * Content of the fence, without the fence lines. */ source: string; /** * Offset of the first character of the opening fence line. */ start: number; /** * Offset just after the closing fence (before its line break). */ end: number; /** * The opening fence run (backticks or tildes). */ fence: string; /** * Raw info string after the fence (trimmed). */ info: string; /** * Parsed attributes. */ attrs: FenceAttrs; /** * 1-based line of the opening fence. */ line: number; }; export type Region = { kind: "region"; lang: string; /** * Decoded source text. */ source: string; start: number; end: number; /** * Always the empty string. */ fence: string; /** * Decoded info string of the original fence. */ info: string; attrs: FenceAttrs; line: number; /** * Hash stored in the begin marker. */ hash: string; }; export type ScanItem = FenceBlock | Region; /** * Attributes parsed from a fence info string (theme, clean, seed, width, alt, src). * @typedef {object} FenceAttrs * @property {string} [theme] * @property {boolean} [clean] * @property {string} [seed] * @property {number} [width] * @property {string} [alt] * @property {string} [src] Relative path to a PlantUML source file for document rendering. */ /** * A fenced PlantUML block. * @typedef {object} FenceBlock * @property {"fence"} kind * @property {string} lang Lower-cased language (`plantuml`, `puml` or `uml`). * @property {string} source Content of the fence, without the fence lines. * @property {number} start Offset of the first character of the opening fence line. * @property {number} end Offset just after the closing fence (before its line break). * @property {string} fence The opening fence run (backticks or tildes). * @property {string} info Raw info string after the fence (trimmed). * @property {FenceAttrs} attrs Parsed attributes. * @property {number} line 1-based line of the opening fence. */ /** * A block that was rendered earlier with `keepSource` (marker comments). * @typedef {object} Region * @property {"region"} kind * @property {string} lang * @property {string} source Decoded source text. * @property {number} start * @property {number} end * @property {string} fence Always the empty string. * @property {string} info Decoded info string of the original fence. * @property {FenceAttrs} attrs * @property {number} line * @property {string} hash Hash stored in the begin marker. */ /** @typedef {FenceBlock | Region} ScanItem */ export declare const BEGIN_PREFIX = ""; export declare const SOURCE_PREFIX = "`, `--!>` and `