codekingpro/portable-devtools
114k
1Metadata-Version: 2.4
2Name: MarkupSafe
3Version: 3.0.3
4Summary: Safely add untrusted strings to HTML/XML markup.
5Maintainer-email: Pallets <contact@palletsprojects.com>
6License-Expression: BSD-3-Clause
7Project-URL: Donate, https://palletsprojects.com/donate
8Project-URL: Documentation, https://markupsafe.palletsprojects.com/
9Project-URL: Changes, https://markupsafe.palletsprojects.com/page/changes/
10Project-URL: Source, https://github.com/pallets/markupsafe/
11Project-URL: Chat, https://discord.gg/pallets
12Classifier: Development Status :: 5 - Production/Stable
13Classifier: Environment :: Web Environment
14Classifier: Intended Audience :: Developers
15Classifier: Operating System :: OS Independent
16Classifier: Programming Language :: Python
17Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
18Classifier: Topic :: Text Processing :: Markup :: HTML
19Classifier: Typing :: Typed
20Requires-Python: >=3.9
21Description-Content-Type: text/markdown
22License-File: LICENSE.txt
23Dynamic: license-file
24
25<div align="center"><img src="https://raw.githubusercontent.com/pallets/markupsafe/refs/heads/stable/docs/_static/markupsafe-name.svg" alt="" height="150"></div>
26
27# MarkupSafe
28
29MarkupSafe implements a text object that escapes characters so it is
30safe to use in HTML and XML. Characters that have special meanings are
31replaced so that they display as the actual characters. This mitigates
32injection attacks, meaning untrusted user input can safely be displayed
33on a page.
34
35
36## Examples
37
38```pycon
39>>> from markupsafe import Markup, escape
40
41>>> # escape replaces special characters and wraps in Markup
42>>> escape("<script>alert(document.cookie);</script>")
43Markup('<script>alert(document.cookie);</script>')
44
45>>> # wrap in Markup to mark text "safe" and prevent escaping
46>>> Markup("<strong>Hello</strong>")
47Markup('<strong>hello</strong>')
48
49>>> escape(Markup("<strong>Hello</strong>"))
50Markup('<strong>hello</strong>')
51
52>>> # Markup is a str subclass
53>>> # methods and operators escape their arguments
54>>> template = Markup("Hello <em>{name}</em>")
55>>> template.format(name='"World"')
56Markup('Hello <em>"World"</em>')
57```
58
59## Donate
60
61The Pallets organization develops and supports MarkupSafe and other
62popular packages. In order to grow the community of contributors and
63users, and allow the maintainers to devote more time to the projects,
64[please donate today][].
65
66[please donate today]: https://palletsprojects.com/donate
67
68## Contributing
69
70See our [detailed contributing documentation][contrib] for many ways to
71contribute, including reporting issues, requesting features, asking or answering
72questions, and making PRs.
73
74[contrib]: https://palletsprojects.com/contributing/
75 