1
0
mirror of https://github.com/konpa/devicon.git synced 2025-04-21 13:21:56 +02:00

Check-svgs won't check for styles in SVGs (#807)

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>
This commit is contained in:
Thomas Bui 2021-08-13 11:25:09 -07:00 committed by GitHub
parent 3de92a7065
commit e5aa8a9cad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,7 @@ def check_svgs(svg_file_paths: List[Path]):
err_msg.append(f"-root is '{root.tag}'. Root must be an 'svg' element")
if root.get("viewBox") != "0 0 128 128":
err_msg.append("-'viewBox' is not '0 0 128 128' -> Set it or scale the file using https://www.iloveimg.com/resize-image/resize-svg")
err_msg.append("-'viewBox' is not '0 0 128 128' -> Set it or scale the file using https://www.iloveimg.com/resize-image/resize-svg.")
if root.get("x") is not None:
err_msg.append("-unneccessary 'x' attribute in svg root element -> Remove it")
@ -75,10 +75,6 @@ def check_svgs(svg_file_paths: List[Path]):
if root.get("y") is not None:
err_msg.append("-unneccessary 'y' attribute in svg root element -> Remove it")
style = root.findtext(f".//{namespace}style")
if style != None and "fill" in style:
err_msg.append("-contains style declaration using 'fill' -> Replace classes with the 'fill' attribute instead")
if len(err_msg) > 1:
err_msgs.append("\n".join(err_msg))
except et.ParseError as e: