Skip to content

Commit

Permalink
Merge pull request #891 from ZeitOnline/renovate/markupsafe-3.x
Browse files Browse the repository at this point in the history
MAINT: markupsafe v3 upgrade json patch
  • Loading branch information
stollero authored Oct 18, 2024
2 parents 8dff9a7 + 7470f4b commit 62e7b8c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/zeit/content/text/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def __contains__(self, key):


def json_escape(value):
if isinstance(value, str):
# type Markup inherits from str
# but Markup.replace escapes the replacement arguments!
if type(value) is str: # noqa: E721
return value.replace('"', r'\"')
elif isinstance(value, Undefined):
return ''
Expand Down

0 comments on commit 62e7b8c

Please sign in to comment.