feat: label code fences so Vicinae can colour them (#10)

This commit was merged in pull request #10.
This commit is contained in:
2026-10-03 21:37:11 +00:00
parent c49ffeb274
commit ac2da73669
6 changed files with 358 additions and 1 deletions
+19
View File
@@ -127,6 +127,25 @@ describe("buildThreadMarkdown", () => {
expect(markdown).toContain("Ollama rejected the API key.");
});
it("labels a bare code fence inside an answer", () => {
// Vicinae gives a dark panel, a language header and a Copy button
// (`MdCodeBlock.qml`); the label is what turns on syntax colouring.
const markdown = buildThreadMarkdown([
message({ role: "assistant", text: "Run this:\n\n```\ngit status\n```" }),
]);
expect(markdown).toContain("```bash");
});
it("leaves a fence the model already labelled alone", () => {
const markdown = buildThreadMarkdown([
message({ role: "assistant", text: "```rust\nfn main() {}\n```" }),
]);
expect(markdown).toContain("```rust");
expect(markdown).not.toContain("```bash");
});
it("lists tools on one quiet line, flagging failures", () => {
const markdown = buildThreadMarkdown([
message({