/** * Allow-list SVG sanitiser for inlining diagrams into HTML/Markdown. * * The renderer already escapes all text, but inline SVG shares the page with * untrusted content, so the output is re-parsed and rebuilt from an allow-list: * only known elements and attributes survive, there are no scripts, event * handlers, `foreignObject`, external resources or `url(...)` references, and * the result is always well-formed. The scanner is linear (no backtracking). * @module markdown/sanitize */ export type SanitizeOptions = { /** * CSS scope prefix for the `text` rule (e.g. `.excaliplant`). */ scope?: string; /** * Rescale the root element to this pixel width. */ width?: number; }; /** * Rebuild an SVG document from an allow-list. * @param {string} svg * @param {SanitizeOptions} [options] * @returns {string} Sanitised SVG; throws if there is no `` root. */ export declare function sanitizeSvg(svg: string, options?: SanitizeOptions): string; /** * Sanitize a playground hook preview for inline SVG under the site's CSP. * @param {string} svg */ export declare function sanitizeHookPreview(svg: string): string;