Skip to content

Commit e9b7141

Browse files
committed
enclose text/compound slot attributes in backticks - fixes #2061
1 parent cf77548 commit e9b7141

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

src/utils/get_slot_data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function(attributes) {
1111
? '""'
1212
: attribute.chunks.length === 1 && attribute.chunks[0].type !== 'Text'
1313
? snip(attribute.chunks[0])
14-
: stringify_attribute(attribute);
14+
: '`' + stringify_attribute(attribute) + '`';
1515

1616
return `${attribute.name}: ${value}`;
1717
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<slot value="Hi" />
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
html: `<p>Hi</p>`
3+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script>
2+
import Nested from './Nested.html';
3+
</script>
4+
5+
<Nested let:value>
6+
<p>{value}</p>
7+
</Nested>

0 commit comments

Comments
 (0)