fix: allow `{@html await ...}` on the server

pull/16817/head
ComputerGuy 2 days ago
parent 3c694ce3a4
commit 539af17112

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow `{@html await ...}` on the server

@ -9,5 +9,10 @@ import * as b from '#compiler/builders';
*/
export function HtmlTag(node, context) {
const expression = /** @type {Expression} */ (context.visit(node.expression));
context.state.template.push(b.call('$.html', expression));
const call = b.call('$.html', expression);
context.state.template.push(
node.metadata.expression.has_await
? b.stmt(b.call('$$renderer.push', b.thunk(call, true)))
: call
);
}

Loading…
Cancel
Save