fix: strip markdown for TTS + render rich markdown in chat UI

- _md_to_speech(): AST-based markdown stripping via markdown-it-py
- Truncate TTS input at 450 chars on sentence boundary (chatterbox overflow)
- chat.js: render assistant messages as markdown via marked.js + DOMPurify
- Typewriter accumulates raw text, renders markdown progressively
This commit is contained in:
marauder-actual
2026-05-29 19:05:04 +02:00
parent 34295d2f14
commit 13bb1c354b
3 changed files with 78 additions and 3 deletions
+2
View File
@@ -14,6 +14,8 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Caveat:wght@400;500&family=Inter:wght@300;400;500;600&family=Source+Serif+Pro:ital,wght@0,400;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap">
<link rel="stylesheet" href="/static/chat.css">
<script src="https://cdn.jsdelivr.net/npm/marked@15/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dompurify@3/dist/purify.min.js"></script>
</head>
<body
data-palette="{{ ui_palette }}"