Skip to content

Commit 7dc9122

Browse files
committed
update
1 parent a6abcf1 commit 7dc9122

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

packages/svelte/src/internal/server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export function createRawSnippet({ render }) {
170170
payload.out += body;
171171
}
172172
if (head) {
173-
payload.head.out += body;
173+
payload.head.out += head;
174174
}
175175
};
176176
add_snippet_symbol(snippet_fn);

packages/svelte/tests/runtime-runes/samples/snippet-raw-args/_config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ export default test({
55
compileOptions: {
66
dev: true // Render in dev mode to check that the validation error is not thrown
77
},
8-
html: `<div><div>0</div></div><button>+</button>`,
8+
html: `<div>0</div><button>+</button>`,
99

1010
test({ assert, target }) {
1111
const [b1] = target.querySelectorAll('button');
1212

1313
b1?.click();
1414
flushSync();
15-
assert.htmlEqual(target.innerHTML, `<div><div>1</div></div><button>+</button>`);
15+
assert.htmlEqual(target.innerHTML, `<div>1</div><button>+</button>`);
1616
}
1717
});

packages/svelte/types/index.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,10 @@ declare module 'svelte' {
371371
export function createRawSnippet({ mount, hydrate }: {
372372
mount: (...params: any[]) => Element;
373373
hydrate?: (element: Element, ...params: any[]) => void;
374-
render: (...params: any[]) => string;
374+
render: (...params: any[]) => {
375+
head: string;
376+
body: string;
377+
};
375378
}): (anchor: TemplateNode, ...params: any[]) => void;
376379
/**
377380
* Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.

0 commit comments

Comments
 (0)