Closed tatarize closed 1 year ago
Issue popping up again when using some wikipedia SVGs.
E.g. https://upload.wikimedia.org/wikipedia/commons/5/58/Axis_Occupation_of_Europe_%281942%29.svg
Issue popping up again when using some wikipedia SVGs.
E.g. https://upload.wikimedia.org/wikipedia/commons/5/58/Axis_Occupation_of_Europe_%281942%29.svg
<style type="text/css" id="style10" />
This isn't really comments in the style but related since it's trying to strip the CSS Comment with a regex. The issue here is that for some random reason the Wikipedia svg in question has no style text. It's an empty style tag conveying no information. This wasn't accounted for and tries to apply the strip the comments from a
None
value. This isn't so much more of the same bug but a bug caused by this solution.
The rest seems fairly fine. I'll post the patch shortly.
Yes you're right. Temporarily, my solution is to parse the svg as xml, check for empty style tags, remove it, save it to svg. Then load it to svgelements lib
But it would be better if you could handle this case internally
This was fixed in 1.7.4.
assignments = list(re.findall(REGEX_CSS_STYLE, elem.text))
I believe this might be caused if elem.text is None. This would imply:
As a tag could cause a crash.
CSS does not properly match and exclude CSS comments.