From f32c6bc693301a6f8e17169129c4f1c1d4b21b2e Mon Sep 17 00:00:00 2001 From: Doug Parker Date: Sun, 12 Mar 2023 22:27:55 -0700 Subject: [PATCH] Removes `pretty` option from `renderToHtml`. Refs #71. As much as I like this option for inspectability, it actually changes the output formatting introduces whitespace around elements where it shouldn't. This causes HTML to render the text with additional spaces. Therefore we _must_ disable `pretty` to get the correct rendered output. --- packages/preact/index.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/preact/index.mts b/packages/preact/index.mts index b973d901..6fc37596 100644 --- a/packages/preact/index.mts +++ b/packages/preact/index.mts @@ -22,7 +22,7 @@ export function renderToHtml(node: VNode | VNode[]): rulesPrerender.SafeHtml { throw new Error(`Expected a single \`VNode\` of the \`\` tag, but got a \`<${node.type}>\` tag instead.`); } - const html = render(node, {}, { pretty: true }); + const html = render(node, {}); // If the user renders a component, we can't know what element it will // actually be until after rendering.