diff --git a/packages/utils/src/svg/encode-svg-for-css.ts b/packages/utils/src/svg/encode-svg-for-css.ts index 8ddabe9..845e549 100644 --- a/packages/utils/src/svg/encode-svg-for-css.ts +++ b/packages/utils/src/svg/encode-svg-for-css.ts @@ -1,10 +1,17 @@ // https://bl.ocks.org/jennyknuth/222825e315d45a738ed9d6e04c7a88d0 export function encodeSvgForCss(svg: string): string { - return svg.replace(/"/g, '\'') + let useSvg = svg.startsWith('') ? svg.replace('', '') : svg; + if (!useSvg.includes(' xmlns:xlink=') && useSvg.includes(' xlink:')) { + useSvg = useSvg.replace('/g, '%3E') + .replace(/>/g, '%3E'); }