diff --git a/src/apps/chat/components/message/blocks.ts b/src/apps/chat/components/message/blocks.ts index cfdf7617c..ee8f8612b 100644 --- a/src/apps/chat/components/message/blocks.ts +++ b/src/apps/chat/components/message/blocks.ts @@ -10,6 +10,11 @@ export function parseBlocks(forceText: boolean, text: string): Block[] { if (forceText) return [{ type: 'text', content: text }]; + // noinspection HtmlRequiredTitleElement + // special case: this could be generated by a proxy that returns an HTML page instead of the API response + if (text.startsWith('\n')) + return [{ type: 'html', html: text }]; + const regexPatterns = { codeBlock: /`{3,}([\w\\.+-_]+)?\n([\s\S]*?)(`{3,}\n?|$)/g, imageBlock: /(https:\/\/images\.prodia\.xyz\/.*?\.png)/g, // NOTE: only Prodia for now - but this shall be expanded to markdown images ![alt](url) or any png/jpeg