{"id":20850339,"url":"https://github.com/webchemistry/html-purifier","last_synced_at":"2026-04-25T10:32:11.956Z","repository":{"id":62547467,"uuid":"175470642","full_name":"WebChemistry/html-purifier","owner":"WebChemistry","description":"simple html-purifier","archived":false,"fork":false,"pushed_at":"2019-03-13T17:54:07.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-19T06:11:19.976Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebChemistry.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}},"created_at":"2019-03-13T17:44:04.000Z","updated_at":"2019-03-13T17:53:13.000Z","dependencies_parsed_at":"2022-11-02T22:15:40.349Z","dependency_job_id":null,"html_url":"https://github.com/WebChemistry/html-purifier","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebChemistry%2Fhtml-purifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebChemistry%2Fhtml-purifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebChemistry%2Fhtml-purifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebChemistry%2Fhtml-purifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebChemistry","download_url":"https://codeload.github.com/WebChemistry/html-purifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243216031,"owners_count":20255300,"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-11-18T03:09:03.315Z","updated_at":"2025-12-25T10:31:11.080Z","avatar_url":"https://github.com/WebChemistry.png","language":"PHP","readme":"## Simple html purifier\n\n\nUsage:\n\n```php\n$rules = new Rules();\n\n$rules-\u003eaddMulti(\n\tElementRule::create('i'),\n\tElementRule::create('div'),\n\tElementRule::create('strong')\n\t\t-\u003eaddAttributeRule(\n\t\t\tAttributeRule::create('class')\n\t\t\t\t-\u003eallowValue('italic')\n\t\t),\n\tElementRule::create('script')\n\t\t-\u003ediscard(),\n\tElementRule::create('span')\n\t\t-\u003eaddAttributeRule(\n\t\t\tAttributeStyleRule::create()\n\t\t\t\t-\u003eaddRule('color', ['white', '#fff', '#fffff'])\n\t\t)\n);\n\n$purifier = new Purifier($rules);\n\n$purifier-\u003epurify('\n\t\u003cdiv\u003e\n\t\tLorem ipsum \u003cstrong class=\"italic h2\"\u003eis simply\u003c/strong\u003e\n\t\t\n\t\t\u003cscript\u003ealert(\"dummy text!\")\u003c/script\u003e\n\n\t\t\u003cspan style=\"color: #FFF;font-weight: bold\"\u003ewhite\u003c/span\u003e and \u003cspan style=\"color: red\"\u003ered\u003c/span\u003e\n\n\t\t\u003cbr\u003e\n\t\u003c/div\u003e\n');\n```\n\noutput:\n\n```html\n\u003cdiv\u003e\n\tLorem ipsum \u003cstrong class=\"italic\"\u003eis simply\u003c/strong\u003e\n\t\n\t\u003cspan style=\"color: #FFF;\"\u003ewhite\u003c/span\u003e and \u003cspan\u003ered\u003c/span\u003e\n\u003c/div\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebchemistry%2Fhtml-purifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebchemistry%2Fhtml-purifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebchemistry%2Fhtml-purifier/lists"}