From 84b36c710987a34dd42cb690ab0f0b78b8c5c27a Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 12 Jun 2016 15:36:02 +0200 Subject: [PATCH 1/2] Only include "standalone" attribute if it was explicitly set to "yes" in input document ("no" is the default value) --- scour/scour.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scour/scour.py b/scour/scour.py index 0112ad1..1f14181 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -3090,7 +3090,10 @@ def scourString(in_string, options=None): # return the string with its XML prolog and surrounding comments if options.strip_xml_prolog == False: - total_output = '\n' + total_output = '\n' else: total_output = "" From f83b03707b62197346589fa065c1fcb822171ba1 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 12 Jun 2016 15:42:30 +0200 Subject: [PATCH 2/2] Fix unittests for previous commit --- testscour.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testscour.py b/testscour.py index af9ce96..ee2eef7 100755 --- a/testscour.py +++ b/testscour.py @@ -1031,7 +1031,7 @@ class DoNotPrettyPrintWhenWhitespacePreserved(unittest.TestCase): def runTest(self): with open('unittests/whitespace-important.svg') as f: s = scour.scourString(f.read()).splitlines() - c = ''' + c = ''' This is some messed-up markup @@ -1044,7 +1044,7 @@ class DoNotPrettyPrintWhenNestedWhitespacePreserved(unittest.TestCase): def runTest(self): with open('unittests/whitespace-nested.svg') as f: s = scour.scourString(f.read()).splitlines() - c = ''' + c = ''' Use bold text