Fix Bug 603994, fix parsing of <style> element contents when a CDATA is present
Fix Bug 583758, added a bit to the Inkscape help text saying that groups aren't collapsed if IDs are also not stripped.
Fix Bug 583458, another typo in the Inkscape help tab.
Fix Bug 594930, In a <switch>, require one level of <g> if there was a <g> in the file already. Otherwise, only the first subelement of the <g> is chosen and rendered.
diff --git a/scour.py b/scour.py
index ac7c05a..9fb530c 100755
--- a/scour.py
+++ b/scour.py
@@ -35,6 +35,8 @@
# at rounded corners)
# Next Up:
+# - why are marker-start, -end not removed from the style attribute?
+# - why are only overflow style properties considered and not attributes?
# - only remove unreferenced elements if they are not children of a referenced element
# - add an option to remove ids if they match the Inkscape-style of IDs
# - investigate point-reducing algorithms
@@ -69,7 +71,7 @@ except ImportError:
APP = 'scour'
VER = '0.25'
-COPYRIGHT = 'Copyright Jeff Schiller, 2010'
+COPYRIGHT = 'Copyright Jeff Schiller, Louis Simard, 2010'
NS = { 'SVG': 'http://www.w3.org/2000/svg',
'XLINK': 'http://www.w3.org/1999/xlink',
@@ -107,6 +109,9 @@ svgAttributes = [
'font-weight',
'line-height',
'marker',
+ 'marker-end',
+ 'marker-mid',
+ 'marker-start',
'opacity',
'overflow',
'stop-color',
diff --git a/testscour.py b/testscour.py
index c467f97..ea1481d 100755
--- a/testscour.py
+++ b/testscour.py
@@ -1136,6 +1136,15 @@ class ShortenIDsInStyleCDATA(unittest.TestCase):
self.assertEquals(docStr.find('somethingreallylong'), -1,
'Did not shorten IDs in the internal stylesheet')
+class StyleToAttr(unittest.TestCase):
+ def runTest(self):
+ doc = scour.scourXmlFile('unittests/style-to-attr.svg')
+ line = doc.getElementsByTagName('line')[0]
+ self.assertEquals(line.getAttribute('stroke'), '#000')
+ self.assertEquals(line.getAttribute('marker-start'), 'url(#m)')
+ self.assertEquals(line.getAttribute('marker-mid'), 'url(#m)')
+ self.assertEquals(line.getAttribute('marker-end'), 'url(#m)')
+
# TODO: write tests for --enable-viewboxing
# TODO; write a test for embedding rasters
# TODO: write a test for --disable-embed-rasters
diff --git a/unittests/style-to-attr.svg b/unittests/style-to-attr.svg
new file mode 100644
index 0000000..570a802
--- /dev/null
+++ b/unittests/style-to-attr.svg
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file