Skip to content

Commit d7112ad

Browse files
committed
Add documentation for enableEsiTags option
1 parent 3bdaef4 commit d7112ad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ See [test/index.ts](./test/index.ts) for a more traditional `HTMLRewriter`
4848
implementation that doesn't have the caveats listed below, but restricts input
4949
and output to strings.
5050

51+
To enable the
52+
[`html_rewriter_treats_esi_include_as_void_tag`](https://developers.cloudflare.com/workers/platform/compatibility-dates#htmlrewriter-handling-of-esiinclude)
53+
compatibility flag, set `enableEsiTags` when constructing the `HTMLRewriter`:
54+
55+
```js
56+
const rewriter = new HTMLRewriter((outputChunk) => { ... }, {
57+
enableEsiTags: true,
58+
});
59+
```
60+
5161
## Caveats
5262

5363
- Once `write` or `end` has been called, you cannot add any more handlers. You

0 commit comments

Comments
 (0)