Fix #296, don't remove elements with referenced children
This commit is contained in:
parent
0609c59676
commit
544027fa94
3 changed files with 22 additions and 3 deletions
|
|
@ -379,6 +379,13 @@ class KeepUnreferencedDefs(unittest.TestCase):
|
|||
self.assertEqual(len(doc.getElementsByTagNameNS(SVGNS, 'circle')), 1,
|
||||
'Unreferenced circle removed from defs with `--keep-unreferenced-defs`')
|
||||
|
||||
class KeepUnreferencedElementWithReferencedChild(unittest.TestCase):
|
||||
def runTest(self):
|
||||
doc = scourXmlFile('unittests/referenced_child.svg')
|
||||
|
||||
self.assertEqual(len(doc.getElementsByTagNameNS(SVGNS, 'rect')), 1,
|
||||
'Referenced element was deleted')
|
||||
|
||||
|
||||
class DoNotRemoveChainedRefsInDefs(unittest.TestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue