turnilo icon indicating copy to clipboard operation
turnilo copied to clipboard

support floating point values in the viewBox property

Open cedrics opened this issue 4 years ago • 1 comments

I got an SVG icon from our designers and the viewBox property had a floating-point value in it, so the property was not assigned. Small fix for that 😸

cedrics avatar Aug 13 '20 13:08 cedrics

I'm wondering if we should match anything specific there? We wan't to pick viewBox attribute and pass it further.

By the way original code looks weird. It matches viewBox, strips <svg> from string but only if it has space in it (ergo any attribute). Could you clean up this code a bit, since you're modifying it? Maybe we should createDocumentFragment with svg string content and read viewBox using DOM API and take innerText instead of stripping string with regexes?

adrianmroz avatar Aug 13 '20 14:08 adrianmroz