{"id":13416116,"url":"https://github.com/mozilla/bleach","last_synced_at":"2025-05-12T05:30:15.350Z","repository":{"id":550626,"uuid":"525316","full_name":"mozilla/bleach","owner":"mozilla","description":"Bleach is an allowed-list-based HTML sanitizing library that escapes or strips markup and attributes","archived":false,"fork":false,"pushed_at":"2025-05-01T16:29:27.000Z","size":1243,"stargazers_count":2692,"open_issues_count":4,"forks_count":251,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-05-12T02:44:56.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bleach.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mozilla.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2010-02-19T01:12:41.000Z","updated_at":"2025-05-11T02:46:13.000Z","dependencies_parsed_at":"2024-02-26T01:49:16.333Z","dependency_job_id":"decf071f-99e2-4d26-87ba-10cf181cab48","html_url":"https://github.com/mozilla/bleach","commit_stats":{"total_commits":712,"total_committers":81,"mean_commits":8.790123456790123,"dds":0.5997191011235955,"last_synced_commit":"73871d766de1e33a296eeb4f9faf2451f28bee39"},"previous_names":[],"tags_count":62,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Fbleach","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Fbleach/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Fbleach/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mozilla%2Fbleach/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mozilla","download_url":"https://codeload.github.com/mozilla/bleach/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672731,"owners_count":21945482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T21:00:54.494Z","updated_at":"2025-05-12T05:30:15.282Z","avatar_url":"https://github.com/mozilla.png","language":"Python","readme":"======\nBleach\n======\n\n.. image:: https://github.com/mozilla/bleach/workflows/Test/badge.svg\n   :target: https://github.com/mozilla/bleach/actions?query=workflow%3ATest\n\n.. image:: https://github.com/mozilla/bleach/workflows/Lint/badge.svg\n   :target: https://github.com/mozilla/bleach/actions?query=workflow%3ALint\n\n.. image:: https://badge.fury.io/py/bleach.svg\n   :target: http://badge.fury.io/py/bleach\n\n**NOTE: 2023-01-23: Bleach is deprecated.** See issue:\n`\u003chttps://github.com/mozilla/bleach/issues/698\u003e`__\n\nBleach is an allowed-list-based HTML sanitizing library that escapes or strips\nmarkup and attributes.\n\nBleach can also linkify text safely, applying filters that Django's ``urlize``\nfilter cannot, and optionally setting ``rel`` attributes, even on links already\nin the text.\n\nBleach is intended for sanitizing text from *untrusted* sources. If you find\nyourself jumping through hoops to allow your site administrators to do lots of\nthings, you're probably outside the use cases. Either trust those users, or\ndon't.\n\nBecause it relies on html5lib_, Bleach is as good as modern browsers at dealing\nwith weird, quirky HTML fragments. And *any* of Bleach's methods will fix\nunbalanced or mis-nested tags.\n\nThe version on GitHub_ is the most up-to-date and contains the latest bug\nfixes. You can find full documentation on `ReadTheDocs`_.\n\n:Code:           https://github.com/mozilla/bleach\n:Documentation:  https://bleach.readthedocs.io/\n:Issue tracker:  https://github.com/mozilla/bleach/issues\n:License:        Apache License v2; see LICENSE file\n\n\nReporting Bugs\n==============\n\nFor regular bugs, please report them `in our issue tracker\n\u003chttps://github.com/mozilla/bleach/issues\u003e`_.\n\nIf you believe that you've found a security vulnerability, please `file a secure\nbug report in our bug tracker\n\u003chttps://bugzilla.mozilla.org/enter_bug.cgi?assigned_to=nobody%40mozilla.org\u0026product=Webtools\u0026component=Bleach-security\u0026groups=webtools-security\u003e`_\nor send an email to *security AT mozilla DOT org*.\n\nFor more information on security-related bug disclosure and the PGP key to use\nfor sending encrypted mail or to verify responses received from that address,\nplease read our wiki page at\n`\u003chttps://www.mozilla.org/en-US/security/#For_Developers\u003e`_.\n\n\nSecurity\n========\n\nBleach is a security-focused library.\n\nWe have a responsible security vulnerability reporting process. Please use\nthat if you're reporting a security issue.\n\nSecurity issues are fixed in private. After we land such a fix, we'll do a\nrelease.\n\nFor every release, we mark security issues we've fixed in the ``CHANGES`` in\nthe **Security issues** section. We include any relevant CVE links.\n\n\nInstalling Bleach\n=================\n\nBleach is available on PyPI_, so you can install it with ``pip``::\n\n    $ pip install bleach\n\n\nUpgrading Bleach\n================\n\n.. warning::\n\n   Before doing any upgrades, read through `Bleach Changes\n   \u003chttps://bleach.readthedocs.io/en/latest/changes.html\u003e`_ for backwards\n   incompatible changes, newer versions, etc.\n\n   Bleach follows `semver 2`_ versioning. Vendored libraries will not\n   be changed in patch releases.\n\n\nBasic use\n=========\n\nThe simplest way to use Bleach is:\n\n.. code-block:: python\n\n    \u003e\u003e\u003e import bleach\n\n    \u003e\u003e\u003e bleach.clean('an \u003cscript\u003eevil()\u003c/script\u003e example')\n    u'an \u0026lt;script\u0026gt;evil()\u0026lt;/script\u0026gt; example'\n\n    \u003e\u003e\u003e bleach.linkify('an http://example.com url')\n    u'an \u003ca href=\"http://example.com\" rel=\"nofollow\"\u003ehttp://example.com\u003c/a\u003e url'\n\n\nCode of Conduct\n===============\n\nThis project and repository is governed by Mozilla's code of conduct and\netiquette guidelines. For more details please see the `CODE_OF_CONDUCT.md\n\u003c/CODE_OF_CONDUCT.md\u003e`_\n\n\n.. _html5lib: https://github.com/html5lib/html5lib-python\n.. _GitHub: https://github.com/mozilla/bleach\n.. _ReadTheDocs: https://bleach.readthedocs.io/\n.. _PyPI: https://pypi.org/project/bleach/\n.. _semver 2: https://semver.org/\n","funding_links":[],"categories":["Python Packages","HTML Manipulation","Libs","Python","HTML 处理","HTML操作","Third-Party Packages","HTML Processing","HTML Manipulation [🔝](#readme)","Awesome Python"],"sub_categories":["Views","Other","Templates","Forms","Python libraries","HTML Manipulation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozilla%2Fbleach","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmozilla%2Fbleach","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozilla%2Fbleach/lists"}