diff --git a/src/interface/obsidian/src/chat_view.ts b/src/interface/obsidian/src/chat_view.ts index b175ad11..87df8a91 100644 --- a/src/interface/obsidian/src/chat_view.ts +++ b/src/interface/obsidian/src/chat_view.ts @@ -322,6 +322,12 @@ export class KhojChatView extends KhojPaneView { // @ts-ignore MarkdownRenderer.renderMarkdown(markdownText, virtualChatMessageBodyTextEl, '', null); + // Remove image HTML elements with any non whitelisted src prefix + virtualChatMessageBodyTextEl.innerHTML = virtualChatMessageBodyTextEl.innerHTML.replace( + //gis, + '' + ); + // Sanitize the markdown text rendered as HTML return DOMPurify.sanitize(virtualChatMessageBodyTextEl.innerHTML); }