{"id":15413680,"url":"https://github.com/lucacasonato/ammonia-wasm","last_synced_at":"2025-04-19T12:06:06.483Z","repository":{"id":38189176,"uuid":"388474227","full_name":"lucacasonato/ammonia-wasm","owner":"lucacasonato","description":"WASM bindings for the Ammonia HTML sanitizer","archived":false,"fork":false,"pushed_at":"2022-06-09T17:41:12.000Z","size":2811,"stargazers_count":20,"open_issues_count":6,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-06T10:49:00.215Z","etag":null,"topics":["deno","html5","sanitizer","wasm"],"latest_commit_sha":null,"homepage":"https://deno.land/x/ammonia","language":"TypeScript","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/lucacasonato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-22T13:35:30.000Z","updated_at":"2023-07-28T00:29:22.000Z","dependencies_parsed_at":"2022-08-26T20:30:37.699Z","dependency_job_id":null,"html_url":"https://github.com/lucacasonato/ammonia-wasm","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucacasonato%2Fammonia-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucacasonato%2Fammonia-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucacasonato%2Fammonia-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucacasonato%2Fammonia-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucacasonato","download_url":"https://codeload.github.com/lucacasonato/ammonia-wasm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":220109683,"owners_count":16595985,"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":["deno","html5","sanitizer","wasm"],"created_at":"2024-10-01T16:58:31.203Z","updated_at":"2024-10-17T17:20:16.619Z","avatar_url":"https://github.com/lucacasonato.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ammonia-wasm\n\n[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/ammonia@0.3.1/mod.ts)\n\nWASM bindings for the\n[Ammonia HTML sanitizer](https://github.com/rust-ammonia/ammonia).\n\n\u003e Ammonia is a whitelist-based HTML sanitization library written in Rust. It is\n\u003e designed to prevent cross-site scripting, layout breaking, and clickjacking\n\u003e caused by untrusted user-provided HTML being mixed into a larger web page.\n\n\u003e Ammonia uses [html5ever](https://github.com/servo/html5ever) to parse and\n\u003e serialize document fragments the same way browsers do, so it is extremely\n\u003e resilient to syntactic obfuscation.\n\n\u003e Ammonia parses its input exactly according to the HTML5 specification; it will\n\u003e not linkify bare URLs, insert line or paragraph breaks, or convert (C) into ©.\n\u003e If you want that, use a markup processor before running the sanitizer.\n\n## How to use\n\n```ts\nimport * as ammonia from \"https://deno.land/x/ammonia@0.3.1/mod.ts\";\nawait ammonia.init();\n\n// Simple cleaning with conservative defaults.\nammonia.clean(\"XSS\u003cscript\u003eattack\u003c/script\u003e\"); // XSS\n\n// Custom options\nconst builder = new ammonia.AmmoniaBuilder();\nbuilder.tags.delete(\"p\"); // strip the \u003cp\u003e tag\nconst cleaner = builder.build();\nammonia.clean(\"foo\u003cp\u003ebar\u003c/p\u003e\"); // foobar\n```\n\nFor exact details on the options on `AmmoniaBuilder` or any other API, view\n[deno doc](https://doc.deno.land/https/deno.land/x/ammonia@0.3.1/mod.ts).\n\n## Thanks\n\nThanks to the authors of Ammonia (@notriddle, and @lnicola), the countless of\ncontributors to html5ever, and the HTML spec authors.\n\nAdditional thanks to the @denosaurs folks for the build.ts script this repo\nuses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucacasonato%2Fammonia-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucacasonato%2Fammonia-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucacasonato%2Fammonia-wasm/lists"}