We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a90b965 commit 2a23587Copy full SHA for 2a23587
roundup/cgi/templating.py
@@ -79,8 +79,14 @@ def _import_markdown():
79
# make sure any HTML tags get escaped
80
class EscapeHtml(MarkdownExtension):
81
def extendMarkdown(self, md, md_globals=None):
82
- md.preprocessors.deregister('html_block')
83
- md.inlinePatterns.deregister('html')
+ if hasattr(md.preprocessors, 'deregister'):
+ md.preprocessors.deregister('html_block')
84
+ else:
85
+ del md.preprocessors['html_block']
86
+ if hasattr(md.inlinePatterns, 'deregister'):
87
+ md.inlinePatterns.deregister('html')
88
89
+ del md.inlinePatterns['html']
90
91
markdown = lambda s: markdown_impl(s, extensions=[EscapeHtml(), 'fenced_code'])
92
except ImportError:
0 commit comments