Urara-Blog/node_modules/.pnpm-store/v3/files/ef/f07b7fab078ee8dab384737c87dac53b32574df0870bdc2cf3f01c846106b60285d34c4b0ccd5868919ae7e90320f49ea49e1dc0bc1da3b629efa233b58624
2022-08-14 01:14:53 +08:00

16 lines
688 B
Text

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function encodeSvgForCss(svg) {
let useSvg = svg.startsWith("<svg>") ? svg.replace("<svg>", "<svg >") : svg;
if (!useSvg.includes(" xmlns:xlink=") && useSvg.includes(" xlink:")) {
useSvg = useSvg.replace("<svg ", '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ');
}
if (!useSvg.includes(" xmlns=")) {
useSvg = useSvg.replace("<svg ", '<svg xmlns="http://www.w3.org/2000/svg" ');
}
return useSvg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/{/g, "%7B").replace(/}/g, "%7D").replace(/</g, "%3C").replace(/>/g, "%3E");
}
exports.encodeSvgForCss = encodeSvgForCss;