METADATA 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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: 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.6
  28. Description-Content-Type: text/x-rst
  29. MarkupSafe
  30. ==========
  31. MarkupSafe implements a text object that escapes characters so it is
  32. safe to use in HTML and XML. Characters that have special meanings are
  33. replaced so that they display as the actual characters. This mitigates
  34. injection attacks, meaning untrusted user input can safely be displayed
  35. on a page.
  36. Installing
  37. ----------
  38. Install and update using `pip`_:
  39. .. code-block:: text
  40. pip install -U MarkupSafe
  41. .. _pip: https://pip.pypa.io/en/stable/quickstart/
  42. Examples
  43. --------
  44. .. code-block:: pycon
  45. >>> from markupsafe import Markup, escape
  46. >>> # escape replaces special characters and wraps in Markup
  47. >>> escape("<script>alert(document.cookie);</script>")
  48. Markup('&lt;script&gt;alert(document.cookie);&lt;/script&gt;')
  49. >>> # wrap in Markup to mark text "safe" and prevent escaping
  50. >>> Markup("<strong>Hello</strong>")
  51. Markup('<strong>hello</strong>')
  52. >>> escape(Markup("<strong>Hello</strong>"))
  53. Markup('<strong>hello</strong>')
  54. >>> # Markup is a str subclass
  55. >>> # methods and operators escape their arguments
  56. >>> template = Markup("Hello <em>{name}</em>")
  57. >>> template.format(name='"World"')
  58. Markup('Hello <em>&#34;World&#34;</em>')
  59. Donate
  60. ------
  61. The Pallets organization develops and supports MarkupSafe and other
  62. popular packages. In order to grow the community of contributors and
  63. users, and allow the maintainers to devote more time to the projects,
  64. `please donate today`_.
  65. .. _please donate today: https://palletsprojects.com/donate
  66. Links
  67. -----
  68. - Documentation: https://markupsafe.palletsprojects.com/
  69. - Changes: https://markupsafe.palletsprojects.com/changes/
  70. - PyPI Releases: https://pypi.org/project/MarkupSafe/
  71. - Source Code: https://github.com/pallets/markupsafe/
  72. - Issue Tracker: https://github.com/pallets/markupsafe/issues/
  73. - Website: https://palletsprojects.com/p/markupsafe/
  74. - Twitter: https://twitter.com/PalletsTeam
  75. - Chat: https://discord.gg/pallets