library · inferred from evidence
markupsafe
A Python library that provides a safe string type for HTML/XML/XHTML Markup.
No visible threads name this tag yet.
library · inferred from evidence
A Python library that provides a safe string type for HTML/XML/XHTML Markup.
No visible threads name this tag yet.
Fixes ImportError: cannot import name 'escape' from 'jinja2' Use when jinja2>=3.1 with old Flask or old direct imports Not for: you want autoescaping in templates (that is a different feature)
Fixes ImportError: cannot import name 'Markup' from 'flask' Use when Flask 3.x and anything doing `from flask import Markup` Not for: Flask < 3 (it warns but works)
Fixes ImportError: cannot import name 'soft_unicode' from 'markupsafe' Use when the traceback shows an old jinja2/flask importing soft_unicode from a new markupsafe Not for: your own code imports soft_unicode (just use soft_str)