{"id":15752705,"url":"https://github.com/remram44/bleached","last_synced_at":"2025-03-31T07:27:23.351Z","repository":{"id":152262968,"uuid":"623700808","full_name":"remram44/bleached","owner":"remram44","description":"Validate HTML against a small subset (for example generated by bleach)","archived":false,"fork":false,"pushed_at":"2024-12-17T20:05:37.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T21:11:16.665Z","etag":null,"topics":["bleach","html","html-sanitization","sanitizer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remram44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-04T22:46:36.000Z","updated_at":"2024-12-21T17:13:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e0fba8c-d370-46fc-845c-88e98e8c2fd8","html_url":"https://github.com/remram44/bleached","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"69a3726158fcf585ebfaed2bfc11b2029ba840b8"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remram44%2Fbleached","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remram44%2Fbleached/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remram44%2Fbleached/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remram44%2Fbleached/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remram44","download_url":"https://codeload.github.com/remram44/bleached/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246431749,"owners_count":20776279,"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":["bleach","html","html-sanitization","sanitizer"],"created_at":"2024-10-04T07:04:21.700Z","updated_at":"2025-03-31T07:27:23.329Z","avatar_url":"https://github.com/remram44.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bleached\n\nThis is a small HTML checker. It can validate that HTML code is safe.\n\nIt does not aim to support the entire HTML spec, rather it focuses on checking HTML that has been run through a sanitizer (such as [bleach](https://github.com/mozilla/bleach)).\n\n## How to use?\n\n```\n$ pip install bleached\n$ python3\n\u003e\u003e\u003e import bleached\n\u003e\u003e\u003e bleached.is_html_bleached('\u003cp\u003eHello world\u003c/p\u003e')\nTrue\n\u003e\u003e\u003e bleached.is_html_bleached('\u003cscript\u003ealert(\"Hello world\");\u003c/script\u003e')\nFalse\n\u003e\u003e\u003e bleached.check_html('\u003cp\u003eHello world\u003c/p\u003e')\n\u003e\u003e\u003e bleached.check_html('\u003cscript\u003ealert(\"Hello world\");\u003c/script\u003e')\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nbleached.UnsafeInput: Line 1 character 8 (input index 7): Found forbidden opening tag 'script'\n```\n\n## Why use this?\n\n[bleach](https://github.com/mozilla/bleach) is a great library for sanitizing untrusted HTML. You should use it instead of this where possible.\n\nHowever, it offers no way to check that a piece of HTML has been sanitized. Running the HTML through bleach again will only work if you have the exact same version, as bleach makes no guarantee of stability of their input. This is where bleached is useful.\n\n## Warnings\n\n* No validation of attributes is performed. If you choose to allow an attribute, it is up to you to validate the values.\n* This accepts a much smaller subset of HTML than web browsers. Be ready for false negatives if you use this to validate HTML documents.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremram44%2Fbleached","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremram44%2Fbleached","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremram44%2Fbleached/lists"}