Change argument from inline to inline-css
This commit is contained in:
parent
72208624a9
commit
e9fd11abd7
2 changed files with 4 additions and 4 deletions
|
|
@ -1793,7 +1793,7 @@ def repairStyle(node, options):
|
||||||
num += 1
|
num += 1
|
||||||
|
|
||||||
if node.nodeType == Node.ELEMENT_NODE:
|
if node.nodeType == Node.ELEMENT_NODE:
|
||||||
if options.style_type == "inline":
|
if options.style_type == "inline-css":
|
||||||
# Prefer inline style
|
# Prefer inline style
|
||||||
# Remove known SVG attributes and store their values in style attribute
|
# Remove known SVG attributes and store their values in style attribute
|
||||||
attributes = [node.attributes.item(i) for i in range(node.attributes.length)]
|
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")
|
help="won't convert styles into XML attributes")
|
||||||
_option_group_optimization.add_option("--style",
|
_option_group_optimization.add_option("--style",
|
||||||
action="store", type="string", dest="style_type", default="none", metavar="TYPE",
|
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)")
|
"attributes (default: %none)")
|
||||||
_option_group_optimization.add_option("--disable-group-collapsing",
|
_option_group_optimization.add_option("--disable-group-collapsing",
|
||||||
action="store_false", dest="group_collapse", default=True,
|
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")
|
_options_parser.error("Value for --nindent should be positive (or zero), see --help")
|
||||||
if options.infilename and options.outfilename and options.infilename == options.outfilename:
|
if options.infilename and options.outfilename and options.infilename == options.outfilename:
|
||||||
_options_parser.error("Input filename is the same as output filename")
|
_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")
|
_options_parser.error("Invalid value for --style, see --help")
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
|
|
||||||
|
|
@ -2217,7 +2217,7 @@ class AttrToStyle(unittest.TestCase):
|
||||||
|
|
||||||
def runTest(self):
|
def runTest(self):
|
||||||
doc = scourXmlFile('unittests/attr-to-style.svg',
|
doc = scourXmlFile('unittests/attr-to-style.svg',
|
||||||
parse_args(['--style=inline']))
|
parse_args(['--style=inline-css']))
|
||||||
line = doc.getElementsByTagName('line')[0]
|
line = doc.getElementsByTagName('line')[0]
|
||||||
self.assertEqual(line.getAttribute('stroke'), '')
|
self.assertEqual(line.getAttribute('stroke'), '')
|
||||||
self.assertEqual(line.getAttribute('marker-start'), '')
|
self.assertEqual(line.getAttribute('marker-start'), '')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue