From 0da7f3191eae62b50c406fbcf83bca652ea0feb9 Mon Sep 17 00:00:00 2001 From: amy wieliczka Date: Fri, 9 Feb 2024 12:26:06 -0800 Subject: [PATCH] Update markdownify template_tag per markdown changelog --- exhibits/templatetags/markdown_filter.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/exhibits/templatetags/markdown_filter.py b/exhibits/templatetags/markdown_filter.py index 32b33ed3..c69e3fd0 100644 --- a/exhibits/templatetags/markdown_filter.py +++ b/exhibits/templatetags/markdown_filter.py @@ -6,10 +6,14 @@ # per notes in the release docs for version 2.5, used an EscapeHTML # extension to replace safe_mode="escape" (deprecated) +# https://python-markdown.github.io/changelog/#safe_mode-and-html_replacement_text-keywords-deprecated +# https://python-markdown.github.io/changelog/#md_globals-keyword-deprecated-from-extension-api +# https://python-markdown.github.io/changelog/#previously-deprecated-objects-have-been-removed + class EscapeHtml(Extension): - def extendMarkdown(self, md, md_globals): - del md.preprocessors['html_block'] - del md.inlinePatterns['html'] + def extendMarkdown(self, md): + md.preprocessors.deregister('html_block') + md.inlinePatterns.deregister('html') register = Library()