const EXAMPLE_BLOCK_SRC_PATTERN = /]*\bsrc\s*=\s*["']([^"']+)["'][^>]*>/g; /** `src` values from `` opening tags, including tags split across lines. */ export function exampleBlockSources(contents: string): Array { return [...contents.matchAll(EXAMPLE_BLOCK_SRC_PATTERN)].flatMap((match) => { const src = match[1]; return src === undefined ? [] : [src]; }); }