METADATA 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. Metadata-Version: 2.1
  2. Name: MarkupSafe
  3. Version: 3.0.2
  4. Summary: Safely add untrusted strings to HTML/XML markup.
  5. Maintainer-email: Pallets <contact@palletsprojects.com>
  6. License: Copyright 2010 Pallets
  7. Redistribution and use in source and binary forms, with or without
  8. modification, are permitted provided that the following conditions are
  9. met:
  10. 1. Redistributions of source code must retain the above copyright
  11. notice, this list of conditions and the following disclaimer.
  12. 2. Redistributions in binary form must reproduce the above copyright
  13. notice, this list of conditions and the following disclaimer in the
  14. documentation and/or other materials provided with the distribution.
  15. 3. Neither the name of the copyright holder nor the names of its
  16. contributors may be used to endorse or promote products derived from
  17. this software without specific prior written permission.
  18. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  21. PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  24. TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  25. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  26. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  27. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. Project-URL: Donate, https://palletsprojects.com/donate
  30. Project-URL: Documentation, https://markupsafe.palletsprojects.com/
  31. Project-URL: Changes, https://markupsafe.palletsprojects.com/changes/
  32. Project-URL: Source, https://github.com/pallets/markupsafe/
  33. Project-URL: Chat, https://discord.gg/pallets
  34. Classifier: Development Status :: 5 - Production/Stable
  35. Classifier: Environment :: Web Environment
  36. Classifier: Intended Audience :: Developers
  37. Classifier: License :: OSI Approved :: BSD License
  38. Classifier: Operating System :: OS Independent
  39. Classifier: Programming Language :: Python
  40. Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
  41. Classifier: Topic :: Text Processing :: Markup :: HTML
  42. Classifier: Typing :: Typed
  43. Requires-Python: >=3.9
  44. Description-Content-Type: text/markdown
  45. License-File: LICENSE.txt
  46. # MarkupSafe
  47. MarkupSafe implements a text object that escapes characters so it is
  48. safe to use in HTML and XML. Characters that have special meanings are
  49. replaced so that they display as the actual characters. This mitigates
  50. injection attacks, meaning untrusted user input can safely be displayed
  51. on a page.
  52. ## Examples
  53. ```pycon
  54. >>> from markupsafe import Markup, escape
  55. >>> # escape replaces special characters and wraps in Markup
  56. >>> escape("<script>alert(document.cookie);</script>")
  57. Markup('&lt;script&gt;alert(document.cookie);&lt;/script&gt;')
  58. >>> # wrap in Markup to mark text "safe" and prevent escaping
  59. >>> Markup("<strong>Hello</strong>")
  60. Markup('<strong>hello</strong>')
  61. >>> escape(Markup("<strong>Hello</strong>"))
  62. Markup('<strong>hello</strong>')
  63. >>> # Markup is a str subclass
  64. >>> # methods and operators escape their arguments
  65. >>> template = Markup("Hello <em>{name}</em>")
  66. >>> template.format(name='"World"')
  67. Markup('Hello <em>&#34;World&#34;</em>')
  68. ```
  69. ## Donate
  70. The Pallets organization develops and supports MarkupSafe and other
  71. popular packages. In order to grow the community of contributors and
  72. users, and allow the maintainers to devote more time to the projects,
  73. [please donate today][].
  74. [please donate today]: https://palletsprojects.com/donate