# Python : Pallets : MarkupSafe
\[ [pypi](https://pypi.org/project/MarkupSafe/) | [src](https://github.com/pallets/markupsafe/) | [docs](https://markupsafe.palletsprojects.com/en/2.1.x/) ]
MarkupSafe implements a text object that escapes characters so it is safe to use in HTML and XML.
Characters that have special meanings are replaced so that they display as the actual characters.
This mitigates injection attacks, meaning untrusted user input can safely be displayed on a page.
```python
from markupsafe import escape, Markup
escape( "<strong>Hello</strong>" ) -> Markup( "<strong>Hello</strong>v )
escape( Markup( "<strong>Hello</strong>" ) ) -> Markup( "<strong>Hello</strong>" )
Markup.escape( str ) -> Markup
markup.striptags() -> str # unescape(), remove tags, normalize whitespace to single spaces
markup.unescape() -> str
```
`Markup` is subclassed from `str`.