• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Metadata-Version: 2.2
2Name: MarkupSafe
3Version: 2.1.1
4Summary: Safely add untrusted strings to HTML/XML markup.
5Home-page: https://palletsprojects.com/p/markupsafe/
6Author: Armin Ronacher
7Author-email: armin.ronacher@active-4.com
8Maintainer: Pallets
9Maintainer-email: contact@palletsprojects.com
10License: BSD-3-Clause
11Project-URL: Donate, https://palletsprojects.com/donate
12Project-URL: Documentation, https://markupsafe.palletsprojects.com/
13Project-URL: Changes, https://markupsafe.palletsprojects.com/changes/
14Project-URL: Source Code, https://github.com/pallets/markupsafe/
15Project-URL: Issue Tracker, https://github.com/pallets/markupsafe/issues/
16Project-URL: Twitter, https://twitter.com/PalletsTeam
17Project-URL: Chat, https://discord.gg/pallets
18Description: 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('&lt;script&gt;alert(document.cookie);&lt;/script&gt;')
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>&#34;World&#34;</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
88Platform: UNKNOWN
89Classifier: Development Status :: 5 - Production/Stable
90Classifier: Environment :: Web Environment
91Classifier: Intended Audience :: Developers
92Classifier: License :: OSI Approved :: BSD License
93Classifier: Operating System :: OS Independent
94Classifier: Programming Language :: Python
95Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
96Classifier: Topic :: Text Processing :: Markup :: HTML
97Requires-Python: >=3.6
98Description-Content-Type: text/x-rst
99