fix: extract images from rich text HTML to enable image description quick action
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 34s

This commit is contained in:
2026-05-02 23:41:46 +02:00
parent 01cf5ccad7
commit d0387cd9a0
4 changed files with 42 additions and 13 deletions

View File

@@ -6,6 +6,12 @@ export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function extractImagesFromHTML(html: string): string[] {
if (!html) return [];
const matches = html.matchAll(/<img[^>]+src="([^">]+)"/gi);
return Array.from(matches).map(m => m[1]);
}
/**
* Deep equality check for two values
* More performant than JSON.stringify for comparison