<commit_before>Bleach
======

Bleach is an HTML sanitizing library designed to strip disallowed tags and
attributes based on a whitelist, and can additionally autolinkify URLs in text
with an extra filter layer that Django's ``urlize`` filter doesn't have.


Basic Use
---------

The simplest way to use Bleach::

    >>> from bleach import Bleach

    >>> bl = Bleach()

    >>> bl.clean('an <script>evil()</script> example')
    'an &lt;script&gt;evil()&lt;/script&gt; example'

    # to linkify URLs and email addresses, use
    >>> bl.linkify('a http://example.com url')
    'a <a href="http://example.com" rel="nofollow">http://example.com</a> url'

``clean()`` also fixes up some common errors::

    >>> from bleach import Bleach

    >>> bl = Bleach()

    >>> bl.clean('unbalanced <em>tag')
    'unbalanced <em>tag</em>'

<commit_msg>Added a pointer to github to the readme.<commit_after>Bleach
======

Bleach is an HTML sanitizing library designed to strip disallowed tags and
attributes based on a whitelist, and can additionally autolinkify URLs in text
with an extra filter layer that Django's ``urlize`` filter doesn't have.

*The version on `github <http://github.com/jsocol/bleach>`_ is the most
up-to-date and contains the latest bug fixes.*


Basic Use
---------

The simplest way to use Bleach::

    >>> from bleach import Bleach

    >>> bl = Bleach()

    >>> bl.clean('an <script>evil()</script> example')
    'an &lt;script&gt;evil()&lt;/script&gt; example'

    # to linkify URLs and email addresses, use
    >>> bl.linkify('a http://example.com url')
    'a <a href="http://example.com" rel="nofollow">http://example.com</a> url'

``clean()`` also fixes up some common errors::

    >>> from bleach import Bleach

    >>> bl = Bleach()

    >>> bl.clean('unbalanced <em>tag')
    'unbalanced <em>tag</em>'


{'fraction_non_alphanumeric': 0.15493726132024005, 'fraction_numerical': 0.0, 'mean_word_length': 3.5964912280701755, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6554134', 'n_tokens_mistral': 616, 'n_tokens_neox': 555, 'n_words': 198}