You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

308 lines
8.7 KiB

  1. Metadata-Version: 2.0
  2. Name: bleach
  3. Version: 1.5.0
  4. Summary: An easy whitelist-based HTML-sanitizing tool.
  5. Home-page: http://github.com/mozilla/bleach
  6. Author: Will Kahn-Greene
  7. Author-email: UNKNOWN
  8. License: Apache Software License
  9. Platform: UNKNOWN
  10. Classifier: Development Status :: 5 - Production/Stable
  11. Classifier: Environment :: Web Environment
  12. Classifier: Intended Audience :: Developers
  13. Classifier: License :: OSI Approved :: Apache Software License
  14. Classifier: Operating System :: OS Independent
  15. Classifier: Programming Language :: Python
  16. Classifier: Programming Language :: Python :: 2
  17. Classifier: Programming Language :: Python :: 2.6
  18. Classifier: Programming Language :: Python :: 2.7
  19. Classifier: Programming Language :: Python :: 3
  20. Classifier: Programming Language :: Python :: 3.2
  21. Classifier: Programming Language :: Python :: 3.3
  22. Classifier: Programming Language :: Python :: 3.4
  23. Classifier: Programming Language :: Python :: 3.5
  24. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  25. Requires-Dist: six
  26. Requires-Dist: html5lib (>=0.999,!=0.9999,!=0.99999,<0.99999999)
  27. ======
  28. Bleach
  29. ======
  30. .. image:: https://travis-ci.org/mozilla/bleach.png?branch=master
  31. :target: https://travis-ci.org/mozilla/bleach
  32. .. image:: https://badge.fury.io/py/Bleach.svg
  33. :target: http://badge.fury.io/py/Bleach
  34. Bleach is a whitelist-based HTML sanitizing library that escapes or strips
  35. markup and attributes.
  36. Bleach can also linkify text safely, applying filters that Django's ``urlize``
  37. filter cannot, and optionally setting ``rel`` attributes, even on links already
  38. in the text.
  39. Bleach is intended for sanitizing text from *untrusted* sources. If you find
  40. yourself jumping through hoops to allow your site administrators to do lots of
  41. things, you're probably outside the use cases. Either trust those users, or
  42. don't.
  43. Because it relies on html5lib_, Bleach is as good as modern browsers at dealing
  44. with weird, quirky HTML fragments. And *any* of Bleach's methods will fix
  45. unbalanced or mis-nested tags.
  46. The version on GitHub_ is the most up-to-date and contains the latest bug
  47. fixes. You can find full documentation on `ReadTheDocs`_.
  48. :Code: https://github.com/mozilla/bleach
  49. :Documentation: https://bleach.readthedocs.io/
  50. :Issue tracker: https://github.com/mozilla/bleach/issues
  51. :IRC: ``#bleach`` on irc.mozilla.org
  52. :License: Apache License v2; see LICENSE file
  53. Reporting Bugs
  54. ==============
  55. For regular bugs, please report them `in our issue tracker
  56. <https://github.com/mozilla/bleach/issues>`_.
  57. If you believe that you've found a security vulnerability, please `file a secure
  58. bug report in our bug tracker
  59. <https://bugzilla.mozilla.org/enter_bug.cgi?assigned_to=nobody%40mozilla.org&product=Webtools&component=Bleach-security&groups=webtools-security>`_
  60. or send an email to *security AT mozilla DOT org*.
  61. For more information on security-related bug disclosure and the PGP key to use
  62. for sending encrypted mail or to verify responses received from that address,
  63. please read our wiki page at
  64. `<https://www.mozilla.org/en-US/security/#For_Developers>`_.
  65. Installing Bleach
  66. =================
  67. Bleach is available on PyPI_, so you can install it with ``pip``::
  68. $ pip install bleach
  69. Or with ``easy_install``::
  70. $ easy_install bleach
  71. Or by cloning the repo from GitHub_::
  72. $ git clone git://github.com/mozilla/bleach.git
  73. Then install it by running::
  74. $ python setup.py install
  75. Upgrading Bleach
  76. ================
  77. .. warning::
  78. Before doing any upgrades, read through `Bleach Changes
  79. <https://bleach.readthedocs.io/en/latest/changes.html>`_ for backwards
  80. incompatible changes, newer versions, etc.
  81. Basic use
  82. =========
  83. The simplest way to use Bleach is:
  84. .. code-block:: python
  85. >>> import bleach
  86. >>> bleach.clean('an <script>evil()</script> example')
  87. u'an &lt;script&gt;evil()&lt;/script&gt; example'
  88. >>> bleach.linkify('an http://example.com url')
  89. u'an <a href="http://example.com" rel="nofollow">http://example.com</a> url
  90. .. _html5lib: https://github.com/html5lib/html5lib-python
  91. .. _GitHub: https://github.com/mozilla/bleach
  92. .. _ReadTheDocs: https://bleach.readthedocs.io/
  93. .. _PyPI: http://pypi.python.org/pypi/bleach
  94. Bleach Changes
  95. ==============
  96. Version 1.5 (November 4th, 2016)
  97. --------------------------------
  98. **Backwards incompatible changes**
  99. - clean: The list of ``ALLOWED_PROTOCOLS`` now defaults to http, https and
  100. mailto. Previously it was a long list of protocols something like ed2k, ftp,
  101. http, https, irc, mailto, news, gopher, nntp, telnet, webcal, xmpp, callto,
  102. feed, urn, aim, rsync, tag, ssh, sftp, rtsp, afs, data. #149
  103. **Changes**
  104. - clean: Added ``protocols`` to arguments list to let you override the list of
  105. allowed protocols. Thank you, Andreas Malecki! #149
  106. - linkify: Fix a bug involving periods at the end of an email address. Thank you,
  107. Lorenz Schori! #219
  108. - linkify: Fix linkification of non-ascii ports. Thank you Alexandre, Macabies!
  109. #207
  110. - linkify: Fix linkify inappropriately removing node tails when dropping nodes.
  111. #132
  112. - Fixed a test that failed periodically. #161
  113. - Switched from nose to py.test. #204
  114. - Add test matrix for all supported Python and html5lib versions. #230
  115. - Limit to html5lib ``>=0.999,!=0.9999,!=0.99999,<0.99999999`` because 0.9999
  116. and 0.99999 are busted.
  117. - Add support for ``python setup.py test``. #97
  118. Version 1.4.3 (May 23rd, 2016)
  119. ------------------------------
  120. **Changes**
  121. - Limit to html5lib ``>=0.999,<0.99999999`` because of impending change to
  122. sanitizer api. #195
  123. Version 1.4.2 (September 11, 2015)
  124. ----------------------------------
  125. **Changes**
  126. - linkify: Fix hang in linkify with ``parse_email=True``. #124
  127. - linkify: Fix crash in linkify when removing a link that is a first-child. #136
  128. - Updated TLDs.
  129. - linkify: Don't remove exterior brackets when linkifying. #146
  130. Version 1.4.1 (December 15, 2014)
  131. ---------------------------------
  132. **Changes**
  133. - Consistent order of attributes in output.
  134. - Python 3.4 support.
  135. Version 1.4 (January 12, 2014)
  136. ------------------------------
  137. **Changes**
  138. - linkify: Update linkify to use etree type Treewalker instead of simpletree.
  139. - Updated html5lib to version ``>=0.999``.
  140. - Update all code to be compatible with Python 3 and 2 using six.
  141. - Switch to Apache License.
  142. Version 1.3
  143. -----------
  144. - Used by Python 3-only fork.
  145. Version 1.2.2 (May 18, 2013)
  146. ----------------------------
  147. - Pin html5lib to version 0.95 for now due to major API break.
  148. Version 1.2.1 (February 19, 2013)
  149. ---------------------------------
  150. - clean() no longer considers ``feed:`` an acceptable protocol due to
  151. inconsistencies in browser behavior.
  152. Version 1.2 (January 28, 2013)
  153. ------------------------------
  154. - linkify() has changed considerably. Many keyword arguments have been
  155. replaced with a single callbacks list. Please see the documentation
  156. for more information.
  157. - Bleach will no longer consider unacceptable protocols when linkifying.
  158. - linkify() now takes a tokenizer argument that allows it to skip
  159. sanitization.
  160. - delinkify() is gone.
  161. - Removed exception handling from _render. clean() and linkify() may now
  162. throw.
  163. - linkify() correctly ignores case for protocols and domain names.
  164. - linkify() correctly handles markup within an <a> tag.
  165. Version 1.1.5
  166. -------------
  167. Version 1.1.4
  168. -------------
  169. Version 1.1.3 (July 10, 2012)
  170. -----------------------------
  171. - Fix parsing bare URLs when parse_email=True.
  172. Version 1.1.2 (June 1, 2012)
  173. ----------------------------
  174. - Fix hang in style attribute sanitizer. (#61)
  175. - Allow '/' in style attribute values.
  176. Version 1.1.1 (February 17, 2012)
  177. ---------------------------------
  178. - Fix tokenizer for html5lib 0.9.5.
  179. Version 1.1.0 (October 24, 2011)
  180. --------------------------------
  181. - linkify() now understands port numbers. (#38)
  182. - Documented character encoding behavior. (#41)
  183. - Add an optional target argument to linkify().
  184. - Add delinkify() method. (#45)
  185. - Support subdomain whitelist for delinkify(). (#47, #48)
  186. Version 1.0.4 (September 2, 2011)
  187. ---------------------------------
  188. - Switch to SemVer git tags.
  189. - Make linkify() smarter about trailing punctuation. (#30)
  190. - Pass exc_info to logger during rendering issues.
  191. - Add wildcard key for attributes. (#19)
  192. - Make linkify() use the HTMLSanitizer tokenizer. (#36)
  193. - Fix URLs wrapped in parentheses. (#23)
  194. - Make linkify() UTF-8 safe. (#33)
  195. Version 1.0.3 (June 14, 2011)
  196. -----------------------------
  197. - linkify() works with 3rd level domains. (#24)
  198. - clean() supports vendor prefixes in style values. (#31, #32)
  199. - Fix linkify() email escaping.
  200. Version 1.0.2 (June 6, 2011)
  201. ----------------------------
  202. - linkify() supports email addresses.
  203. - clean() supports callables in attributes filter.
  204. Version 1.0.1 (April 12, 2011)
  205. ------------------------------
  206. - linkify() doesn't drop trailing slashes. (#21)
  207. - linkify() won't linkify 'libgl.so.1'. (#22)