Skip to content

Commit 8817682

Browse files
committed
fix failing test
1 parent 5fb2bb4 commit 8817682

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

packages/svelte/src/compiler/print/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,24 @@ const svelte_visitors = {
870870
context.write(node.data);
871871
},
872872

873+
TitleElement(node, context) {
874+
context.write('<title');
875+
876+
for (const attribute of node.attributes) {
877+
// TODO handle multiline
878+
context.write(' ');
879+
context.visit(attribute);
880+
}
881+
882+
if (node.fragment) {
883+
context.write('>');
884+
block(context, node.fragment, true);
885+
context.write(`</title>`);
886+
} else {
887+
context.write('/>');
888+
}
889+
},
890+
873891
TransitionDirective(node, context) {
874892
const directive = node.intro && node.outro ? 'transition' : node.intro ? 'in' : 'out';
875893
context.write(`${directive}:${node.name}`);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<svelte:head>
2+
<title>Hello world!</title>
3+
<meta name="description" content="This is where the description goes for SEO" />
4+
</svelte:head>

0 commit comments

Comments
 (0)