Afia: render markdown bold in chat instead of showing raw asterisks
Deploy Ladill Hosting / deploy (push) Successful in 1m27s

Replies came back with **bold** markup that displayed literally to users.
Render the bubble as HTML (escaped first for safety) and convert **text** to
<strong>; newlines already handled by whitespace-pre-line.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
isaacclad
2026-06-11 08:41:01 +00:00
co-authored by Claude Opus 4.8
parent a67648e0d3
commit a47b469320
+1 -1
View File
@@ -63,7 +63,7 @@
<div class="flex" :class="m.role === 'user' ? 'justify-end' : 'justify-start'"> <div class="flex" :class="m.role === 'user' ? 'justify-end' : 'justify-start'">
<div class="max-w-[85%] whitespace-pre-line rounded-2xl px-3.5 py-2.5 text-[13px] leading-relaxed" <div class="max-w-[85%] whitespace-pre-line rounded-2xl px-3.5 py-2.5 text-[13px] leading-relaxed"
:class="m.role === 'user' ? 'bg-indigo-600 text-white rounded-br-md' : 'bg-slate-100 text-slate-700 rounded-bl-md'" :class="m.role === 'user' ? 'bg-indigo-600 text-white rounded-br-md' : 'bg-slate-100 text-slate-700 rounded-bl-md'"
x-text="m.text"></div> x-html="m.text.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\*\*([^*]+?)\*\*/g,'<strong>$1</strong>')"></div>
</div> </div>
</template> </template>
<div x-show="loading" class="flex justify-start"> <div x-show="loading" class="flex justify-start">