feat: label code fences so Vicinae can colour them (#10)
This commit was merged in pull request #10.
This commit is contained in:
+8
-1
@@ -1,3 +1,4 @@
|
||||
import { labelCodeFences } from "./code";
|
||||
import type { ChatTurn, ThreadMessage } from "./types";
|
||||
|
||||
/**
|
||||
@@ -53,7 +54,13 @@ function renderMessage(message: ThreadMessage, options: TranscriptOptions): stri
|
||||
// While a tool is running there is no answer text yet, so the activity line
|
||||
// stands in and the user can see what Lam is actually doing.
|
||||
const placeholder = message.status ? `_${message.status}…_` : "_Thinking…_";
|
||||
const body = message.text.trim() || (message.isStreaming ? placeholder : "_No response._");
|
||||
const body = message.text.trim()
|
||||
? // Fences without a language render as a plain dark panel; labelling them
|
||||
// lets Vicinae colour the code (`MdCodeBlock.qml` + KSyntaxHighlighting).
|
||||
labelCodeFences(message.text.trim())
|
||||
: message.isStreaming
|
||||
? placeholder
|
||||
: "_No response._";
|
||||
const sections = [message.isStreaming ? `${body} ${STREAMING_CURSOR}` : body];
|
||||
|
||||
// The one thing allowed to break the plain-text rule, because it means
|
||||
|
||||
Reference in New Issue
Block a user