Skip to content

Commit 3feffe8

Browse files
committed
fix: do not escape HTML
1 parent 4f6cdd9 commit 3feffe8

File tree

1 file changed

+3
-1
lines changed
  • packages/runtime/src/templates/edge-shared

1 file changed

+3
-1
lines changed

packages/runtime/src/templates/edge-shared/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ export const buildResponse = async ({
212212
// Apply all of the transforms to the props
213213
const props = response.dataTransforms.reduce((prev, transform) => transform(prev), data.props)
214214
// Replace the data with the transformed props
215-
textChunk.replace(JSON.stringify({ ...data, props }))
215+
// With `html: true` the input is treated as raw HTML
216+
// @see https://developers.cloudflare.com/workers/runtime-apis/html-rewriter/#global-types
217+
textChunk.replace(JSON.stringify({ ...data, props }), { html: true })
216218
} catch (err) {
217219
console.log('Could not parse', err)
218220
}

0 commit comments

Comments
 (0)