* fix(tts): strip Markdown syntax before sending text to TTS engines Chat responses are rendered as Markdown but the TTS components piped the raw response into Piper / the browser's `SpeechSynthesis` API. The synthesizer reads every special character literally — `**bold**` becomes "asterisk asterisk bold asterisk asterisk", `# Heading` becomes "pound heading", code fences are read backtick-by-backtick, and bullet lists become "hyphen item". The result is unintelligible whenever the assistant includes any formatting, which is most of the time. This commit adds a small `messageToSpeech` helper that converts a Markdown chat message into plain text suitable for TTS: - fenced code blocks and images are dropped (nothing useful to read) - inline code and link labels keep their text content - emphasis markers, headings, blockquote markers, list markers, and horizontal rules are stripped while preserving the underlying words - HTML tags are removed but their text content kept - table pipes become commas so rows read naturally The helper is regex-based — no new dependency — and is wired into both the native (`SpeechSynthesis`) and Piper TTS components in `WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/Actions/TTSButton`. Closes #5557. --- Co-authored-by: Timothy Carambat <rambat1010@gmail.com> |
||
|---|---|---|
| .. | ||
| public | ||
| scripts | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| .nvmrc | ||
| eslint.config.js | ||
| index.html | ||
| jsconfig.json | ||
| package.json | ||
| postcss.config.js | ||
| tailwind.config.js | ||
| vite.config.js | ||
| yarn.lock | ||