Skip to content

Commit 5bfd273

Browse files
pareddaavoo
authored andcommitted
renderers: account for space in plots name
1 parent ce75208 commit 5bfd273

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/dvc_render/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def SCRIPTS(self): # pylint: disable=missing-function-docstring
4848
def remove_special_chars(string: str) -> str:
4949
"Ensure string is valid HTML id."
5050
return string.translate(
51-
{ord(c): "_" for c in r"!@#$%^&*()[]{};,<>?\/:.|`~=_+"}
51+
{ord(c): "_" for c in r"!@#$%^&*()[]{};,<>?\/:.|`~=_+ "}
5252
)
5353

5454
def generate_html(self, html_path=None) -> str:

tests/test_renderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def test_remove_special_characters():
7-
special_chars = r"!@#$%^&*()[]{};,<>?\/:.|`~=_+"
7+
special_chars = r"!@#$%^&*()[]{};,<>?\/:.|`~=_+ "
88
dirty = f"plot_name{special_chars}"
99
assert Renderer.remove_special_chars(dirty) == "plot_name" + "_" * len(
1010
special_chars

0 commit comments

Comments
 (0)