diff --git a/package-lock.json b/package-lock.json index bd5ccbc..7de52ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@evoscientist/webui", - "version": "0.1.4", + "version": "0.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@evoscientist/webui", - "version": "0.1.4", + "version": "0.1.5", "license": "Apache-2.0", "dependencies": { "@langchain/core": "1.1.19", diff --git a/package.json b/package.json index c8a98a4..ce5b710 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@evoscientist/webui", - "version": "0.1.4", + "version": "0.1.5", "description": "Web UI for EvoScientist — a self-evolving AI scientist built on DeepAgents/LangGraph.", "author": "Xi Zhang ", "type": "module", diff --git a/src/app/components/MarkdownContent.tsx b/src/app/components/MarkdownContent.tsx index a91c6f8..8791022 100644 --- a/src/app/components/MarkdownContent.tsx +++ b/src/app/components/MarkdownContent.tsx @@ -62,7 +62,12 @@ export const MarkdownContent = React.memo( children?: React.ReactNode; }) { const match = /language-(\w+)/.exec(className || ""); - const code = String(children).replace(/\n$/, ""); + const raw = String(children); + // Fenced blocks always end with \n; inline code does not. Use + // this to distinguish unlanguaged fenced blocks from inline code + // so detectFileLink is only called for true inline code. + const isBlock = raw.endsWith("\n"); + const code = raw.replace(/\n$/, ""); // react-markdown v9 dropped the `inline` prop. Block code carries // a `language-*` className from the fenced ```lang form; inline // code does not. Treat absence of a language match as inline. @@ -85,7 +90,7 @@ export const MarkdownContent = React.memo( // Inline code that names a workspace or memory file becomes a // click-to-open link. ChatInterface (or any ancestor) listens // for `evosci:open-file` and routes to the right dialog. - const link = detectFileLink(code); + const link = !isBlock ? detectFileLink(code) : null; if (link) { return ( @@ -270,7 +302,10 @@ export function ToolApprovalInterrupt({ disabled={isLoading} className="text-destructive hover:bg-destructive/10" > - +