{"id":13539530,"url":"https://github.com/cloudflare/lol-html","last_synced_at":"2026-02-22T14:26:38.233Z","repository":{"id":36408397,"uuid":"207206333","full_name":"cloudflare/lol-html","owner":"cloudflare","description":"Low output latency streaming HTML parser/rewriter with CSS selector-based API","archived":false,"fork":false,"pushed_at":"2025-05-06T23:27:13.000Z","size":3148,"stargazers_count":1738,"open_issues_count":36,"forks_count":86,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-07T00:29:28.523Z","etag":null,"topics":["css-selectors","html","parser","rewriting","rust","stream","streaming"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/lol-html","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudflare.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-09T02:20:32.000Z","updated_at":"2025-05-06T23:27:17.000Z","dependencies_parsed_at":"2024-01-06T01:09:34.791Z","dependency_job_id":"3b713df8-f14c-4be9-9f4e-f044611687cd","html_url":"https://github.com/cloudflare/lol-html","commit_stats":{"total_commits":472,"total_committers":27,"mean_commits":17.48148148148148,"dds":0.2627118644067796,"last_synced_commit":"379da4b2416b00210b862699469d429562331e1d"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Flol-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Flol-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Flol-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudflare%2Flol-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudflare","download_url":"https://codeload.github.com/cloudflare/lol-html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253969261,"owners_count":21992263,"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":["css-selectors","html","parser","rewriting","rust","stream","streaming"],"created_at":"2024-08-01T09:01:27.297Z","updated_at":"2026-01-08T16:21:47.849Z","avatar_url":"https://github.com/cloudflare.png","language":"Rust","funding_links":[],"categories":["HTML","Rust","html","Frameworks \u0026 Libraries"],"sub_categories":["Utilities \u0026 Processing"],"readme":"# LOL HTML\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/cloudflare/lol-html\"\u003e\n        \u003cimg src=\"media/logo.png\" alt=\"The logo is generated from https://openmoji.org/data/color/svg/1F602.svg by Emily Jäger which is licensed under CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)\" style=\"width:472px; height: 375px\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\n***L**ow **O**utput **L**atency streaming **HTML** rewriter/parser with CSS-selector based API.*\n\nIt is designed to modify HTML on the fly with minimal buffering. It can quickly handle very large\ndocuments, and operate in environments with limited memory resources. More details can be found in the [blog post](https://blog.cloudflare.com/html-parsing-2/).\n\nThe crate serves as a back-end for the HTML rewriting functionality of\n[Cloudflare Workers](https://www.cloudflare.com/en-gb/products/cloudflare-workers/), but can be used\nas a standalone library with a convenient API for a wide variety of HTML rewriting/analysis tasks.\n\n## Documentation\n\nhttps://docs.rs/lol_html/\n\n## Bindings for other programming languages\n- [C](https://github.com/cloudflare/lol-html/tree/master/c-api)\n- [Lua](https://github.com/jdesgats/lua-lolhtml)\n- [Go](https://github.com/coolspring8/go-lolhtml) (unofficial, not coming from Cloudflare)\n- [Ruby](https://github.com/gjtorikian/selma) (unofficial, not coming from Cloudflare)\n\n## Example\n\nRewrite insecure hyperlinks:\n\n```rust\nuse lol_html::{element, HtmlRewriter, Settings};\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let mut output = vec![];\n\n    let mut rewriter = HtmlRewriter::new(\n        Settings {\n            element_content_handlers: vec![\n                element!(\"a[href]\", |el| {\n                    let href = el\n                        .get_attribute(\"href\")\n                        .expect(\"href was required\")\n                        .replace(\"http:\", \"https:\");\n\n                    el.set_attribute(\"href\", \u0026href)?;\n\n                    Ok(())\n                })\n            ],\n            ..Settings::new()\n        },\n        |c: \u0026[u8]| output.extend_from_slice(c)\n    );\n\n    rewriter.write(b\"\u003cdiv\u003e\u003ca href=\")?;\n    rewriter.write(b\"http://example.com\u003e\")?;\n    rewriter.write(b\"\u003c/a\u003e\u003c/div\u003e\")?;\n    rewriter.end()?;\n\n    assert_eq!(\n        String::from_utf8(output)?,\n        r#\"\u003cdiv\u003e\u003ca href=\"https://example.com\"\u003e\u003c/a\u003e\u003c/div\u003e\"#\n    );\n    Ok(())\n}\n```\n\n## License\n\nBSD licensed. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflare%2Flol-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudflare%2Flol-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudflare%2Flol-html/lists"}