From 5a62f888cdd39a1bcddc14face4dad8047260709 Mon Sep 17 00:00:00 2001 From: doom-goober Date: Thu, 23 Dec 2021 16:45:54 -0800 Subject: [PATCH] Move options style_type to sanitizeOptions. --- scour/scour.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scour/scour.py b/scour/scour.py index 73981b2..5774428 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -4084,10 +4084,6 @@ 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 @@ -4104,6 +4100,10 @@ def sanitizeOptions(options=None): sanitizedOptions = _options_parser.get_default_values() sanitizedOptions._update_careful(optionsDict) + #For backwards compatibility, we support style_to_xml but style_type can override it. + if sanitizedOptions.style_type == 'none' and sanitizedOptions.style_to_xml: + sanitizedOptions.style_type = 'attributes' + return sanitizedOptions