Fix Bug 449803 by ensuring input and output filenames differ.
+
Fix Bug 453737 by updated Inkscape's scour extension with a UI
diff --git a/scour.py b/scour.py
index 667945c..659b7a2 100755
--- a/scour.py
+++ b/scour.py
@@ -2098,8 +2098,7 @@ def serializeXML(element, options, ind = 0, preserveWhitespace = False):
elif child.nodeType == 3:
# trim it only in the case of not being a child of an element
# where whitespace might be important
- if element.nodeName in ["text", "tspan", "textPath", "tref", "title", "desc", "textArea",
- "flowRoot", "flowDiv", "flowSpan", "flowPara", "flowRegion"]:
+ if preserveWhitespace:
outString += makeWellFormed(child.nodeValue)
else:
outString += makeWellFormed(child.nodeValue.strip())
diff --git a/testscour.py b/testscour.py
index 7c8322f..e0f49af 100755
--- a/testscour.py
+++ b/testscour.py
@@ -949,7 +949,13 @@ class GetAttrPrefixRight(unittest.TestCase):
def runTest(self):
grad = scour.scourXmlFile('unittests/xml-namespace-attrs.svg').getElementsByTagNameNS(SVGNS, 'linearGradient')[1]
self.assertEquals( grad.getAttributeNS('http://www.w3.org/1999/xlink', 'href'), '#linearGradient841',
- 'Did not get xlink:href prefix right' )
+ 'Did not get xlink:href prefix right')
+
+class EnsurePreserveWhitespaceOnNonTextElements(unittest.TestCase):
+ def runTest(self):
+ s = scour.scourString(open('unittests/no-collapse-lines.svg').read())
+ self.assertEquals( s.count('\n'), 5,
+ 'Did not properly preserve whitespace on elements even if they were not textual')
# TODO; write a test for embedding rasters
# TODO: write a test for --disable-embed-rasters
diff --git a/unittests/no-collapse-lines.svg b/unittests/no-collapse-lines.svg
new file mode 100644
index 0000000..85da385
--- /dev/null
+++ b/unittests/no-collapse-lines.svg
@@ -0,0 +1,8 @@
+
+