move logic to options.style_type not style_to_xml.
This commit is contained in:
parent
e9fd11abd7
commit
6e1afe74d1
1 changed files with 5 additions and 1 deletions
|
|
@ -1805,7 +1805,7 @@ def repairStyle(node, options):
|
||||||
elif options.style_type == "preserve":
|
elif options.style_type == "preserve":
|
||||||
# Keep whatever style of attribute versus style the file currently has
|
# Keep whatever style of attribute versus style the file currently has
|
||||||
pass
|
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
|
# 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
|
# over style so emit them and remove them from the style map
|
||||||
for propName in list(styleMap):
|
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']:
|
if options.style_type not in ['none', 'preserve', 'attributes', 'inline-css']:
|
||||||
_options_parser.error("Invalid value for --style, see --help")
|
_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
|
return options
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue