ALL TESTS PASSING THIS IS NOT A DRILL

pull/12335/head
Rich Harris 2 years ago
parent 8a4883f65e
commit 9f6c0325c8

@ -1350,9 +1350,9 @@ const template_visitors = {
context.visit(node.fragment, state)
);
const body = b.stmt(
b.call('$.element', b.id('$$payload'), tag, b.thunk(attributes), b.thunk(children))
);
const body = b.block([
b.stmt(b.call('$.element', b.id('$$payload'), tag, b.thunk(attributes), b.thunk(children)))
]);
context.state.template.push(block_open, b.if(tag, body), block_close);

@ -1,13 +1,17 @@
<!--[-->
<!--[-->
<title>lorem</title>
<!---->
<!--]-->
<!--[-->
<style>
.ipsum {
display: block;
}
</style>
<!---->
</style>
<!--]-->
<!--[-->
<script>
console.log(true);
</script>
<!----><!--]-->
<!--]-->
<!--]-->

@ -4,6 +4,10 @@ export default function Svelte_element($$payload, $$props) {
let { tag = 'hr' } = $$props;
$$payload.out += `<!--[-->`;
if (tag) $.element($$payload, tag, () => {}, () => {});
if (tag) {
$.element($$payload, tag, () => {}, () => {});
}
$$payload.out += `<!--]-->`;
}
Loading…
Cancel
Save