Jump to >

This documentation covers the in-development release of Djblets. You can see the latest stable docs or all previous versions.


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)[source]

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'.


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.


md (markdown.Markdown) – The Markdown renderer.

makeExtension(*args, **kwargs)[source]

Create and return an instance of this extension.

  • *args (tuple) – Positional arguments for the extension.

  • **kwargs (dict) – Keyword arguments for the extension.


The extension instance.

Return type