turnilo
turnilo copied to clipboard
support floating point values in the viewBox property
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 😸
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?