METADATA 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. Metadata-Version: 2.1
  2. Name: MarkupSafe
  3. Version: 1.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: The Pallets Team
  9. Maintainer-email: contact@palletsprojects.com
  10. License: BSD-3-Clause
  11. Project-URL: Documentation, https://markupsafe.palletsprojects.com/
  12. Project-URL: Code, https://github.com/pallets/markupsafe
  13. Project-URL: Issue tracker, https://github.com/pallets/markupsafe/issues
  14. Platform: UNKNOWN
  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: Programming Language :: Python :: 2
  22. Classifier: Programming Language :: Python :: 2.7
  23. Classifier: Programming Language :: Python :: 3
  24. Classifier: Programming Language :: Python :: 3.4
  25. Classifier: Programming Language :: Python :: 3.5
  26. Classifier: Programming Language :: Python :: 3.6
  27. Classifier: Programming Language :: Python :: 3.7
  28. Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
  29. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  30. Classifier: Topic :: Text Processing :: Markup :: HTML
  31. Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
  32. Description-Content-Type: text/x-rst
  33. MarkupSafe
  34. ==========
  35. MarkupSafe implements a text object that escapes characters so it is
  36. safe to use in HTML and XML. Characters that have special meanings are
  37. replaced so that they display as the actual characters. This mitigates
  38. injection attacks, meaning untrusted user input can safely be displayed
  39. on a page.
  40. Installing
  41. ----------
  42. Install and update using `pip`_:
  43. .. code-block:: text
  44. pip install -U MarkupSafe
  45. .. _pip: https://pip.pypa.io/en/stable/quickstart/
  46. Examples
  47. --------
  48. .. code-block:: pycon
  49. >>> from markupsafe import Markup, escape
  50. >>> # escape replaces special characters and wraps in Markup
  51. >>> escape('<script>alert(document.cookie);</script>')
  52. Markup(u'&lt;script&gt;alert(document.cookie);&lt;/script&gt;')
  53. >>> # wrap in Markup to mark text "safe" and prevent escaping
  54. >>> Markup('<strong>Hello</strong>')
  55. Markup('<strong>hello</strong>')
  56. >>> escape(Markup('<strong>Hello</strong>'))
  57. Markup('<strong>hello</strong>')
  58. >>> # Markup is a text subclass (str on Python 3, unicode on Python 2)
  59. >>> # methods and operators escape their arguments
  60. >>> template = Markup("Hello <em>%s</em>")
  61. >>> template % '"World"'
  62. Markup('Hello <em>&#34;World&#34;</em>')
  63. Donate
  64. ------
  65. The Pallets organization develops and supports MarkupSafe and other
  66. libraries that use it. In order to grow the community of contributors
  67. and users, and allow the maintainers to devote more time to the
  68. projects, `please donate today`_.
  69. .. _please donate today: https://palletsprojects.com/donate
  70. Links
  71. -----
  72. * Website: https://palletsprojects.com/p/markupsafe/
  73. * Documentation: https://markupsafe.palletsprojects.com/
  74. * License: `BSD-3-Clause <https://github.com/pallets/markupsafe/blob/master/LICENSE.rst>`_
  75. * Releases: https://pypi.org/project/MarkupSafe/
  76. * Code: https://github.com/pallets/markupsafe
  77. * Issue tracker: https://github.com/pallets/markupsafe/issues
  78. * Test status:
  79. * Linux, Mac: https://travis-ci.org/pallets/markupsafe
  80. * Windows: https://ci.appveyor.com/project/pallets/markupsafe
  81. * Test coverage: https://codecov.io/gh/pallets/markupsafe
  82. * Official chat: https://discord.gg/t6rrQZH