mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Update html-rewriter.md
This commit is contained in:
@@ -26,7 +26,7 @@ const rewriter = new HTMLRewriter().on("img", {
|
||||
},
|
||||
});
|
||||
|
||||
// Example usage
|
||||
// An example HTML document
|
||||
const html = `
|
||||
<html>
|
||||
<body>
|
||||
@@ -87,8 +87,6 @@ rewriter.transform(Bun.file("index.html"));
|
||||
|
||||
Note that Cloudflare Workers implementation of HTMLRewriter only supports `Response` objects.
|
||||
|
||||
## Features
|
||||
|
||||
### Element Handlers
|
||||
|
||||
The `on(selector, handlers)` method allows you to register handlers for HTML elements that match a CSS selector. The handlers are called for each matching element during parsing:
|
||||
|
||||
Reference in New Issue
Block a user