Afia: render markdown bold in chat instead of showing raw asterisks
Deploy Ladill Hosting / deploy (push) Successful in 1m27s
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:
co-authored by
Claude Opus 4.8
parent
a67648e0d3
commit
a47b469320
@@ -63,7 +63,7 @@
|
||||
<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"
|
||||
: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,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\*\*([^*]+?)\*\*/g,'<strong>$1</strong>')"></div>
|
||||
</div>
|
||||
</template>
|
||||
<div x-show="loading" class="flex justify-start">
|
||||
|
||||
Reference in New Issue
Block a user