export function extractFirstImageUrl(html: string): string | null {
  if (!html || !html.includes('<img')) return null

  const doc = new DOMParser().parseFromString(html, 'text/html')
  const img = doc.querySelector('img[src]')
  const src = img?.getAttribute('src')?.trim()
  return src || null
}
