Fix viewbox whitespace processing.

This fixes processing of files where viewbox has leading/trailing whitespace.

Signed-off-by: Alexey Ivanov <rbtz@ph34r.me>
This commit is contained in:
Alexey Ivanov 2022-04-01 16:46:54 -07:00
parent 0609c59676
commit 5bcaaa4fdb
No known key found for this signature in database
GPG key ID: 8B57EDD96606CE12
3 changed files with 14 additions and 2 deletions

View file

@ -2786,6 +2786,13 @@ class ViewBox(unittest.TestCase):
self.assertEqual(width, '', "width not removed with '--enable-viewboxing'.")
self.assertEqual(height, '', "height not removed with '--enable-viewboxing'.")
def test_viewbox_remove_width_and_height_ws(self):
doc = scourXmlFile('unittests/viewbox-remove-ws.svg', parse_args(['--enable-viewboxing']))
width = doc.documentElement.getAttribute('width')
height = doc.documentElement.getAttribute('height')
self.assertEqual(width, '', "width not removed with '--enable-viewboxing'.")
self.assertEqual(height, '', "height not removed with '--enable-viewboxing'.")
# TODO: write tests for --keep-editor-data