METADATA 2.9 KB

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