From b460712878cdbc232f081ead1d5daff367b88702 Mon Sep 17 00:00:00 2001 From: Mark Miller <725mrm@gmail.com> Date: Sat, 27 Mar 2021 14:26:24 -0700 Subject: [PATCH] Handle extra whitespace in svg element's style value (#1170) --- manim/mobject/svg/style_utils.py | 4 ++-- .../img_svg_resources/multi_part_path.svg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manim/mobject/svg/style_utils.py b/manim/mobject/svg/style_utils.py index f0bc13a2bc..5d25df408d 100644 --- a/manim/mobject/svg/style_utils.py +++ b/manim/mobject/svg/style_utils.py @@ -72,13 +72,13 @@ def cascade_element_style( try: key, value = style_spec.split(":") except ValueError as e: - if not style_spec: + if not style_spec.strip(): # there was just a stray semicolon at the end, producing an emptystring pass else: raise e else: - style[key] = value + style[key.strip()] = value.strip() return style diff --git a/tests/test_graphical_units/img_svg_resources/multi_part_path.svg b/tests/test_graphical_units/img_svg_resources/multi_part_path.svg index 46caa4e022..28eb445732 100644 --- a/tests/test_graphical_units/img_svg_resources/multi_part_path.svg +++ b/tests/test_graphical_units/img_svg_resources/multi_part_path.svg @@ -1,6 +1,6 @@ - + \ No newline at end of file