mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
HTML block: render as HTML, e.g. in case of a full proxy
This commit is contained in:
@@ -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('<!DOCTYPE html') || text.startsWith('<head>\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  or any png/jpeg
|
||||
|
||||
Reference in New Issue
Block a user