const MD_IMG = /!\[[^\]]*\]\((\/images\/[^)\s]+)\)/g const HTML_IMG = /]+src=["'](\/images\/[^"']+)["']/g export function scanImageRefs(source: string): string[] { const set = new Set() for (const m of source.matchAll(MD_IMG)) set.add(m[1]) for (const m of source.matchAll(HTML_IMG)) set.add(m[1]) return [...set] }