UNPKG

analytica-frontend-lib

Version:

Repositório público dos componentes utilizados nas plataformas da Analytica Ensino

33 lines 1.61 kB
import { CSSProperties } from 'react'; import 'katex/dist/katex.min.css'; export interface MarkdownMathRendererProps { /** Markdown content, may contain LaTeX math expressions ($...$ / $$...$$) */ content: string; /** Additional CSS class names */ className?: string; /** Inline styles */ style?: CSSProperties; /** Test ID for testing */ testId?: string; } /** * Escapes the `$` of inline `$...$` spans that do NOT look like real math, so * `remark-math` leaves them as literal text. Without this, currency prose like * "R$ 15,00 ... R$ 42,00" gets paired up and rendered as gibberish math. * * Reuses the exact `looksLikeLatex` heuristic the HTML renderer applies to * single-`$` spans, so both renderers agree on what is math vs currency. * Display math (`$$...$$`) is intentionally left untouched (handled below). */ export declare const protectCurrencyInlineMath: (markdown: string) => string; /** * `remark-math` only renders a `$$...$$` block as centered display math when * the delimiters sit on their own lines ("math flow"). AI content usually puts * the whole equation on a single line (`$$x = y$$`), which would otherwise be * rendered inline. Reflow single-line `$$...$$` into block form so equations * stay centered, matching how the HTML renderer treats `$$`. */ export declare const reflowDisplayMath: (markdown: string) => string; declare const _default: import("react").NamedExoticComponent<MarkdownMathRendererProps & import("react").RefAttributes<HTMLDivElement>>; export default _default; //# sourceMappingURL=MarkdownMathRenderer.d.ts.map