Skip to content

Commit

Permalink
Merge pull request #1775 from sveltejs/gh-1774
Browse files Browse the repository at this point in the history
fix blocks inside <svelte:head>
  • Loading branch information
Rich-Harris authored Oct 20, 2018
2 parents 9395573 + 337b62b commit 635348a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile/render-dom/wrappers/Head.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class HeadWrapper extends Wrapper {
renderer,
block,
node.children,
parent,
this,
stripWhitespace,
nextSibling
);
Expand Down
12 changes: 12 additions & 0 deletions test/runtime/samples/head-if-block/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
data: {
condition: false
},

test(assert, component, target, window) {
assert.equal(window.document.title, '');

component.set({ condition: true });
assert.equal(window.document.title, 'woo!!!');
}
};
5 changes: 5 additions & 0 deletions test/runtime/samples/head-if-block/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<svelte:head>
{#if condition}
<title>woo!!!</title>
{/if}
</svelte:head>

0 comments on commit 635348a

Please sign in to comment.