Skip to content

Commit

Permalink
Use markupsafe.Markup instead of jinja2.Markup
Browse files Browse the repository at this point in the history
This has been deprecated for a while and even before that (since 2.5) it
was just an alias, so switching our import should make no difference
other than working on jinja2 3.1.
  • Loading branch information
mhagander committed Dec 13, 2024
1 parent f3695b6 commit d3735cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion postgresqleu/confreg/jinjafunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from postgresqleu.util.templatetags.assets import do_render_asset
from postgresqleu.util.messaging import get_messaging_class_from_typename

import markupsafe
import jinja2
import jinja2.sandbox
try:
Expand Down Expand Up @@ -319,7 +320,7 @@ def filter_social_links(context, attr):
'timesince': timesince,
'groupby_sort': filter_groupby_sort,
'leadingnbsp': leadingnbsp,
'markdown': lambda t: jinja2.Markup(markdown.markdown(t, extensions=['tables', ])),
'markdown': lambda t: markupsafe.Markup(markdown.markdown(t, extensions=['tables', ])),
'shuffle': filter_shuffle,
'slugify': slugify,
'yesno': lambda b, v: v.split(',')[not b],
Expand Down
3 changes: 2 additions & 1 deletion tools/deploystatic/deploystatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import tarfile
import copy

import markupsafe
import jinja2
import jinja2.sandbox
try:
Expand Down Expand Up @@ -98,7 +99,7 @@ def filter_social_links(context, attr):
'shuffle': filter_shuffle,
'slugify': filter_slugify,
'datetimeformat': filter_datetimeformat,
'markdown': lambda t: jinja2.Markup(markdown.markdown(t)),
'markdown': lambda t: markupsafe.Markup(markdown.markdown(t)),
'social_links': filter_social_links,
}

Expand Down

0 comments on commit d3735cc

Please sign in to comment.