djblets.markdown.extensions.escape_html¶
Markdown extension to safely escape HTML content.
This is built as a replacement for the safe_mode='escape'
Markdown render
mode, which is deprecated in Python-Markdown 2.5.
- class EscapeHTMLExtension(**kwargs)¶
Bases:
Extension
Extension to safely escape HTML content.
This will remove any HTML preprocessors and patterns from the renderer, preventing HTML from being interpreted in any form. This results in the HTML being escaped instead, directly mimicking the behavior of the old
safe_mode='escape'
.- extendMarkdown(md)¶
Extend the list of Markdown processors.
Rather than extending, this will actually remove all HTML-based processors from the renderer, ensuring that the HTML is instead escaped.
- Parameters:
md (
markdown.Markdown
) – The Markdown renderer.
- makeExtension(*args, **kwargs)¶
Create and return an instance of this extension.
- Parameters:
- Returns:
The extension instance.
- Return type: