move logic to options.style_type not style_to_xml.

This commit is contained in:
doom-goober 2021-12-04 09:35:28 -08:00
parent e9fd11abd7
commit 6e1afe74d1

View file

@ -1805,7 +1805,7 @@ def repairStyle(node, options):
elif options.style_type == "preserve":
# Keep whatever style of attribute versus style the file currently has
pass
elif options.style_to_xml or options.style_type == "attributes":
elif options.style_type == "attributes":
# now if any of the properties match known SVG attributes we prefer attributes
# over style so emit them and remove them from the style map
for propName in list(styleMap):
@ -4084,6 +4084,10 @@ def parse_args(args=None, ignore_additional_args=False):
if options.style_type not in ['none', 'preserve', 'attributes', 'inline-css']:
_options_parser.error("Invalid value for --style, see --help")
#For backwards compatibility, we support style_to_xml but style_type can override it.
if options.style_type == 'none' and options.style_to_xml:
options.style_type = 'attributes'
return options