mkdocs-safe-text-plugin
March 2, 2022 ยท View on GitHub
Plugin for safe text editing with MKDocs.
Table of Contents
How does this plugin work?
Markdown is a very flexible format, and raw HTML is allowed. But it is unnecessary in multiple-person text editing.
When raw HTML like <font> tag is used in MKDocs, it is rendered as it is.

If you use this plug-in with MKDocs, tags that are not allowed in the allowlist are escaped.

Installation
Install it via PyPI using pip command.
$ pip install mkdocs-safe-text-plugin
And add it to your mkdocs.yml file.
plugins:
- mkdocs_safe_text
An example of use can be checked by example/basic-usage.
Plugin configuration
This plugin works with the HTML tag element for Markdown defined by bleach-allowlist enabled. This implementation approach is recommended in the Python-Markdown release notes.
And user can change this setting.
plugins:
- mkdocs_safe_text:
append_allowed_tags:
- tag1
- tag2
remove_allowed_tags:
- tag3
- tag4
allowed_attrs:
tag5:
- attribute1
- attribute2
An example of use can be checked by example/customization-usage.