/** * Markdown → the words, for a caption someone READS. * * The live voice caption is the one surface where the model's raw Markdown was * printed literally: bold stars, hash headings, table pipes, fence backticks. * The audio path has been clean for a while (`toSpeakableText`), but that * function is the wrong tool here and reusing it would be worse than the bug. * * ★ `toSpeakableText` is a SCRIPT FOR A VOICE, not a Markdown cleaner. It * replaces a table with "Table with 40 rows and 2 columns", a fenced block with * "Code block", a link with the word "link", and rewrites `x@y.com` as "x at y * dot com" — sensible in an earpiece, destructive on a screen where the reader * can simply read the thing. Worse, those replacements come from an English * default list only localised inside the speech provider, so reusing it would * print English chrome inside a Tamil or Hindi caption: the exact * mixed-language defect that code exists to prevent. * * So this strips MARKERS and keeps CONTENT. Every cell value, all code text, * bare URLs, email addresses, emoji and punctuation survive verbatim. Nothing * is summarised, truncated or annotated: a caption that quietly drops the * user's numbers is a worse failure than one showing a stray asterisk. Where * this function is unsure, it leaves the text ALONE. * * ★ Newlines are PRESERVED, which only helps where the element renders them. * `VoiceCaption` carries `whitespace-pre-wrap` for exactly that. The mini * controller deliberately does NOT: it is `line-clamp-3`, and real newlines * each burn one of the three lines — measured at the strip's true width, that * cut a 116-character reply to 41 visible characters. Markers still go; the * breaks are allowed to collapse on the clamped surface. * * ★ NO LOOKBEHIND ANYWHERE IN CODE. Safari < 16.4 throws on that assertion * class at PARSE time, not match time — one literal takes down the whole chunk * on those devices, and this ships to phones. Lookahead is fine; where a * leading boundary is needed it is CAPTURED and put back. Same rule as * `speakableText.ts`, and `captionText.test.ts` asserts it on the source. */ /** * Strip Markdown markers for display, keeping all of the content. * * Safe on plain text: a reply with no Markdown comes back unchanged. */ export declare function toCaptionText(markdown: string): string; //# sourceMappingURL=captionText.d.ts.map