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:
parent
3de92a7065
commit
e5aa8a9cad
6
.github/scripts/check_svgs_on_pr.py
vendored
6
.github/scripts/check_svgs_on_pr.py
vendored
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user