Skip to content

CanvasAnvil is an open source AI diagram maker and flowchart generator - an infinite-canvas diagram editor and self-hosted drawio alternative that writes editable .drawio files. Text to diagram, then fix nodes, layout and labels in place. Also AI presentations, interior design CAD/BOM, posters and infographics.

flow_bubble_apply_button

codingFeng10124d8f33b19ff
diff --git a/src/workspaces/flow/next/components/chat-message-display.tsx b/src/workspaces/flow/next/components/chat-message-display.tsx
index 3be24f1..de9b7bd 100644
--- a/src/workspaces/flow/next/components/chat-message-display.tsx
+++ b/src/workspaces/flow/next/components/chat-message-display.tsx
@@ -1145,7 +1145,7 @@ export function ChatMessageDisplay({
const lang =
String(
match?.[1] ||
- "xml",
+ "",
).toLowerCase()
const codeText =
String(
@@ -1157,11 +1157,28 @@ export function ChatMessageDisplay({
)
const normalizedLang:
| "xml"
- | "json" =
+ | "json"
+ | null =
+ lang ===
+ "json" ||
lang ===
- "json"
- ? "json"
- : "xml"
+ "xml"
+ ? lang
+ : null
+ if (!normalizedLang) {
+ return (
+ <pre className="overflow-x-auto whitespace-pre-wrap break-words rounded-md bg-muted/30 px-3 py-2 text-[12px] leading-relaxed">
+ <code
+ className={
+ className
+ }
+ {...props}
+ >
+ {codeText}
+ </code>
+ </pre>
+ )
+ }
return (
<CodeBlock
code={