METADATA 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. MarkupSafe
  33. ==========
  34. MarkupSafe implements a text object that escapes characters so it is
  35. safe to use in HTML and XML. Characters that have special meanings are
  36. replaced so that they display as the actual characters. This mitigates
  37. injection attacks, meaning untrusted user input can safely be displayed
  38. on a page.
  39. Installing
  40. ----------
  41. Install and update using `pip`_:
  42. .. code-block:: text
  43. pip install -U MarkupSafe
  44. .. _pip: https://pip.pypa.io/en/stable/quickstart/
  45. Examples
  46. --------
  47. .. code-block:: pycon
  48. >>> from markupsafe import Markup, escape
  49. >>> # escape replaces special characters and wraps in Markup
  50. >>> escape('<script>alert(document.cookie);</script>')
  51. Markup(u'&lt;script&gt;alert(document.cookie);&lt;/script&gt;')
  52. >>> # wrap in Markup to mark text "safe" and prevent escaping
  53. >>> Markup('<strong>Hello</strong>')
  54. Markup('<strong>hello</strong>')
  55. >>> escape(Markup('<strong>Hello</strong>'))
  56. Markup('<strong>hello</strong>')
  57. >>> # Markup is a text subclass (str on Python 3, unicode on Python 2)
  58. >>> # methods and operators escape their arguments
  59. >>> template = Markup("Hello <em>%s</em>")
  60. >>> template % '"World"'
  61. Markup('Hello <em>&#34;World&#34;</em>')
  62. Donate
  63. ------
  64. The Pallets organization develops and supports MarkupSafe and other
  65. libraries that use it. In order to grow the community of contributors
  66. and users, and allow the maintainers to devote more time to the
  67. projects, `please donate today`_.
  68. .. _please donate today: https://palletsprojects.com/donate
  69. Links
  70. -----
  71. * Website: https://palletsprojects.com/p/markupsafe/
  72. * Documentation: https://markupsafe.palletsprojects.com/
  73. * License: `BSD-3-Clause <https://github.com/pallets/markupsafe/blob/master/LICENSE.rst>`_
  74. * Releases: https://pypi.org/project/MarkupSafe/
  75. * Code: https://github.com/pallets/markupsafe
  76. * Issue tracker: https://github.com/pallets/markupsafe/issues
  77. * Test status:
  78. * Linux, Mac: https://travis-ci.org/pallets/markupsafe
  79. * Windows: https://ci.appveyor.com/project/pallets/markupsafe
  80. * Test coverage: https://codecov.io/gh/pallets/markupsafe