/** Release bodies also contain CI build reports; these are not user-facing notes. */ export function releaseNotesText(markdown: string): string { return markdown .replace(/[\s\S]*?/gi, '') .replace(//g, '') .replace(/^\s*```[^\n]*\n[\s\S]*?^\s*```\s*$/gm, '') .replace(/^\s{0,3}#{1,6}\s+/gm, '') .replace(/^\s*>\s?/gm, '') .replace(/!\[([^\]]*)\]\([^)]*\)/g, '$1') .replace(/\[([^\]]+)\]\([^)]*\)/g, '$1') .replace(/(`+)(.*?)\1/g, '$2') .replace(/\*\*(.*?)\*\*|__(.*?)__/g, '$1$2') .replace(/^\s*[-*+]\s+/gm, '• ') .replace(/\n{3,}/g, '\n\n') .trim(); }