diff --git a/index.js b/index.js index aed6db1..78880bc 100644 --- a/index.js +++ b/index.js @@ -197,14 +197,22 @@ function processToolCallMessages() { // Create a container for the rendered markdown const renderContainer = $('
'); - // Add the markdown content (render the image) - renderContainer.html(tool.result); + // Convert markdown to actual HTML img tag + const markdownImgRegex = /!\[\]\(([^)]+)\)/; + const match = tool.result.match(markdownImgRegex); + if (match && match[1]) { + renderContainer.html(`