Closed Steakeye closed 3 years ago
The line source = decodeURIComponent(source); will throw an error if for example an SVG file has something like the foillowing:
source = decodeURIComponent(source);
<defs> <linearGradient id="clion-b" x1="50%" x2="103.297%" y1="28.391%" y2="69.421%"> <stop offset="0%" stop-color="#FF318C"/> <stop offset="100%" stop-color="#009AE5"/> </linearGradient> </defs>
The attributes containing % like x1="50%" will break URI decoding causing the plugin to throw a URIError as it considers the SVG source as a malformed URI.
%
x1="50%"
Fixed in be44ca0bd82ccd9ea79f8881b707a7a9320b6f8a from v1.0.0-beta.2. More explanation here: https://github.com/codefeathers/rollup-plugin-svelte-svg/issues/23#issuecomment-864363144
v1.0.0-beta.2
Thanks!
The line
source = decodeURIComponent(source);
will throw an error if for example an SVG file has something like the foillowing:The attributes containing
%
likex1="50%"
will break URI decoding causing the plugin to throw a URIError as it considers the SVG source as a malformed URI.