0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-29 08:32:05 +01:00

enclose text/compound slot attributes in backticks - fixes #2061

This commit is contained in:
Rich Harris 2019-02-07 11:36:30 -05:00
parent cf775486cf
commit e9b714110c
4 changed files with 12 additions and 1 deletions

View File

@ -11,7 +11,7 @@ export default function(attributes) {
? '""'
: attribute.chunks.length === 1 && attribute.chunks[0].type !== 'Text'
? snip(attribute.chunks[0])
: stringify_attribute(attribute);
: '`' + stringify_attribute(attribute) + '`';
return `${attribute.name}: ${value}`;
});

View File

@ -0,0 +1 @@
<slot value="Hi" />

View File

@ -0,0 +1,3 @@
export default {
html: `<p>Hi</p>`
};

View File

@ -0,0 +1,7 @@
<script>
import Nested from './Nested.html';
</script>
<Nested let:value>
<p>{value}</p>
</Nested>