| 1 |
Metadata-Version: 2.1 |
| 2 |
Name: MarkupSafe |
| 3 |
Version: 2.0.1 |
| 4 |
Summary: Safely add untrusted strings to HTML/XML markup. |
| 5 |
Home-page: https://palletsprojects.com/p/markupsafe/ |
| 6 |
Author: Armin Ronacher |
| 7 |
Author-email: [email protected] |
| 8 |
Maintainer: Pallets |
| 9 |
Maintainer-email: [email protected] |
| 10 |
License: BSD-3-Clause |
| 11 |
Project-URL: Donate, https://palletsprojects.com/donate |
| 12 |
Project-URL: Documentation, https://markupsafe.palletsprojects.com/ |
| 13 |
Project-URL: Changes, https://markupsafe.palletsprojects.com/changes/ |
| 14 |
Project-URL: Source Code, https://github.com/pallets/markupsafe/ |
| 15 |
Project-URL: Issue Tracker, https://github.com/pallets/markupsafe/issues/ |
| 16 |
Project-URL: Twitter, https://twitter.com/PalletsTeam |
| 17 |
Project-URL: Chat, https://discord.gg/pallets |
| 18 |
Description: MarkupSafe |
| 19 |
========== |
| 20 |
|
| 21 |
MarkupSafe implements a text object that escapes characters so it is |
| 22 |
safe to use in HTML and XML. Characters that have special meanings are |
| 23 |
replaced so that they display as the actual characters. This mitigates |
| 24 |
injection attacks, meaning untrusted user input can safely be displayed |
| 25 |
on a page. |
| 26 |
|
| 27 |
|
| 28 |
Installing |
| 29 |
---------- |
| 30 |
|
| 31 |
Install and update using `pip`_: |
| 32 |
|
| 33 |
.. code-block:: text |
| 34 |
|
| 35 |
pip install -U MarkupSafe |
| 36 |
|
| 37 |
.. _pip: https://pip.pypa.io/en/stable/quickstart/ |
| 38 |
|
| 39 |
|
| 40 |
Examples |
| 41 |
-------- |
| 42 |
|
| 43 |
.. code-block:: pycon |
| 44 |
|
| 45 |
>>> from markupsafe import Markup, escape |
| 46 |
|
| 47 |
>>> # escape replaces special characters and wraps in Markup |
| 48 |
>>> escape("<script>alert(document.cookie);</script>") |
| 49 |
Markup('<script>alert(document.cookie);</script>') |
| 50 |
|
| 51 |
>>> # wrap in Markup to mark text "safe" and prevent escaping |
| 52 |
>>> Markup("<strong>Hello</strong>") |
| 53 |
Markup('<strong>hello</strong>') |
| 54 |
|
| 55 |
>>> escape(Markup("<strong>Hello</strong>")) |
| 56 |
Markup('<strong>hello</strong>') |
| 57 |
|
| 58 |
>>> # Markup is a str subclass |
| 59 |
>>> # methods and operators escape their arguments |
| 60 |
>>> template = Markup("Hello <em>{name}</em>") |
| 61 |
>>> template.format(name='"World"') |
| 62 |
Markup('Hello <em>"World"</em>') |
| 63 |
|
| 64 |
|
| 65 |
Donate |
| 66 |
------ |
| 67 |
|
| 68 |
The Pallets organization develops and supports MarkupSafe and other |
| 69 |
popular packages. In order to grow the community of contributors and |
| 70 |
users, and allow the maintainers to devote more time to the projects, |
| 71 |
`please donate today`_. |
| 72 |
|
| 73 |
.. _please donate today: https://palletsprojects.com/donate |
| 74 |
|
| 75 |
|
| 76 |
Links |
| 77 |
----- |
| 78 |
|
| 79 |
- Documentation: https://markupsafe.palletsprojects.com/ |
| 80 |
- Changes: https://markupsafe.palletsprojects.com/changes/ |
| 81 |
- PyPI Releases: https://pypi.org/project/MarkupSafe/ |
| 82 |
- Source Code: https://github.com/pallets/markupsafe/ |
| 83 |
- Issue Tracker: https://github.com/pallets/markupsafe/issues/ |
| 84 |
- Website: https://palletsprojects.com/p/markupsafe/ |
| 85 |
- Twitter: https://twitter.com/PalletsTeam |
| 86 |
- Chat: https://discord.gg/pallets |
| 87 |
|
| 88 |
Platform: UNKNOWN |
| 89 |
Classifier: Development Status :: 5 - Production/Stable |
| 90 |
Classifier: Environment :: Web Environment |
| 91 |
Classifier: Intended Audience :: Developers |
| 92 |
Classifier: License :: OSI Approved :: BSD License |
| 93 |
Classifier: Operating System :: OS Independent |
| 94 |
Classifier: Programming Language :: Python |
| 95 |
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content |
| 96 |
Classifier: Topic :: Text Processing :: Markup :: HTML |
| 97 |
Requires-Python: >=3.6 |
| 98 |
Description-Content-Type: text/x-rst |