/** Two display-only repairs for inputs the old HTML embedding accepted. * Do not rewrite stored artifacts/downloads or attempt general XML repair. * Comments, CDATA and processing instructions are copied verbatim. */ export function svgImageSource(svg: string): string { let foundRoot = false; return svg.replace( /|$)||$)|<\?[\s\S]*?(?:\?>|$)|<\/?[a-zA-Z](?:[^<>"']|"[^"]*"|'[^']*')*>| /g, (token) => { if (token.startsWith("