From e9fd11abd7e70a688b31e7f8f515d9bf95f48013 Mon Sep 17 00:00:00 2001 From: doom-goober Date: Sat, 4 Dec 2021 09:23:15 -0800 Subject: [PATCH] Change argument from inline to inline-css --- scour/scour.py | 6 +++--- test_scour.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scour/scour.py b/scour/scour.py index 0419922..b85d499 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -1793,7 +1793,7 @@ def repairStyle(node, options): num += 1 if node.nodeType == Node.ELEMENT_NODE: - if options.style_type == "inline": + if options.style_type == "inline-css": # Prefer inline style # Remove known SVG attributes and store their values in style attribute attributes = [node.attributes.item(i) for i in range(node.attributes.length)] @@ -3963,7 +3963,7 @@ _option_group_optimization.add_option("--disable-style-to-xml", help="won't convert styles into XML attributes") _option_group_optimization.add_option("--style", action="store", type="string", dest="style_type", default="none", metavar="TYPE", - help="style type (overrides style-to-xml): none, preserve, inline," + help="style type (overrides style-to-xml): none, preserve, inline-css," "attributes (default: %none)") _option_group_optimization.add_option("--disable-group-collapsing", action="store_false", dest="group_collapse", default=True, @@ -4081,7 +4081,7 @@ def parse_args(args=None, ignore_additional_args=False): _options_parser.error("Value for --nindent should be positive (or zero), see --help") if options.infilename and options.outfilename and options.infilename == options.outfilename: _options_parser.error("Input filename is the same as output filename") - if options.style_type not in ['none', 'preserve', 'attributes', 'inline']: + if options.style_type not in ['none', 'preserve', 'attributes', 'inline-css']: _options_parser.error("Invalid value for --style, see --help") return options diff --git a/test_scour.py b/test_scour.py index 4cd82a1..5ca0cc5 100755 --- a/test_scour.py +++ b/test_scour.py @@ -2217,7 +2217,7 @@ class AttrToStyle(unittest.TestCase): def runTest(self): doc = scourXmlFile('unittests/attr-to-style.svg', - parse_args(['--style=inline'])) + parse_args(['--style=inline-css'])) line = doc.getElementsByTagName('line')[0] self.assertEqual(line.getAttribute('stroke'), '') self.assertEqual(line.getAttribute('marker-start'), '')