Skip to content

Commit

Permalink
Removes pretty option from renderToHtml.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dgp1130 committed Mar 13, 2023
1 parent 1ef9daf commit f32c6bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/preact/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function renderToHtml(node: VNode | VNode[]): rulesPrerender.SafeHtml {
throw new Error(`Expected a single \`VNode\` of the \`<html />\` 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.
Expand Down

0 comments on commit f32c6bc

Please sign in to comment.