From 343b12a562c8af441380881846ed1408b3ed3690 Mon Sep 17 00:00:00 2001 From: Andrei Edell Date: Mon, 24 Feb 2025 13:08:23 -1000 Subject: [PATCH] closer --- webview-ui/src/components/mcp/McpResponseDisplay.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webview-ui/src/components/mcp/McpResponseDisplay.tsx b/webview-ui/src/components/mcp/McpResponseDisplay.tsx index 027c1d7188..16e3664984 100644 --- a/webview-ui/src/components/mcp/McpResponseDisplay.tsx +++ b/webview-ui/src/components/mcp/McpResponseDisplay.tsx @@ -273,11 +273,13 @@ const McpResponseDisplay: React.FC = ({ responseText }) const text = responseText || "" const matches: UrlMatch[] = [] - // Find all URLs in the text + // Find all URLs in the text (including at the end of the text) + // Add the text to a space at the end to ensure we catch URLs at the very end + const textWithSpace = text + " " const urlRegex = /https?:\/\/[^\s]+/g let urlMatch: RegExpExecArray | null - while ((urlMatch = urlRegex.exec(text)) !== null) { + while ((urlMatch = urlRegex.exec(textWithSpace)) !== null) { const url = urlMatch[0] const fullMatch = url @@ -369,7 +371,7 @@ const McpResponseDisplay: React.FC = ({ responseText }) src={url} alt={`Image for ${url}`} style={{ - width: "100%", + width: "75%", height: "auto", borderRadius: "4px", cursor: "pointer"