Skip to content

Commit 13f2d21

Browse files
authored
Apply suggestion from @timhoffm
1 parent c2730be commit 13f2d21

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/matplotlib/backends/backend_pgf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ def _metadata_to_str(key, value):
155155
else:
156156
value = str(value)
157157

158+
# ensure that metadata does not contain special TeX chars because we
159+
# insert the metadata as raw text into the TeX source
158160
invalid_chars = r"\{}[]()"
159161
if any(c in value + key for c in invalid_chars):
160162
raise ValueError(

0 commit comments

Comments
 (0)