METADATA 3.2 KB

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