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
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 34s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user