Fix SVG checking.

This commit is contained in:
Sergey Vartanov 2021-10-22 01:37:24 +03:00
parent 1bb26ad95e
commit 347479428a

View file

@ -139,7 +139,8 @@ def verify_sketch_element(element: Element, id_: str) -> bool:
return True return True
style: dict[str, str] = dict( style: dict[str, str] = dict(
[x.split(":") for x in element.attrib["style"].split(";")] (x.split(":")[0], x.split(":")[1])
for x in element.attrib["style"].split(";")
) )
if ( if (
style["fill"] == "none" style["fill"] == "none"
@ -157,7 +158,11 @@ def verify_sketch_element(element: Element, id_: str) -> bool:
): ):
return True return True
if style["fill"] == "#0000ff" and style["stroke"] == "none": if (
style["fill"] == "#0000ff"
and "stroke" in style
and style["stroke"] == "none"
):
return True return True
if style and not id_.startswith("use"): if style and not id_.startswith("use"):