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