From db5cb2de9f5fd2edeeb0f85b3c78fd8ec1042e98 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Thu, 7 Feb 2019 11:36:30 -0500 Subject: [PATCH] enclose text/compound slot attributes in backticks - fixes #2061 --- src/utils/get_slot_data.ts | 2 +- test/runtime/samples/component-slot-let-static/Nested.html | 1 + test/runtime/samples/component-slot-let-static/_config.js | 3 +++ test/runtime/samples/component-slot-let-static/main.html | 7 +++++++ 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/runtime/samples/component-slot-let-static/Nested.html create mode 100644 test/runtime/samples/component-slot-let-static/_config.js create mode 100644 test/runtime/samples/component-slot-let-static/main.html diff --git a/src/utils/get_slot_data.ts b/src/utils/get_slot_data.ts index d5a5205ac9..3b817c8329 100644 --- a/src/utils/get_slot_data.ts +++ b/src/utils/get_slot_data.ts @@ -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}`; }); diff --git a/test/runtime/samples/component-slot-let-static/Nested.html b/test/runtime/samples/component-slot-let-static/Nested.html new file mode 100644 index 0000000000..32eee1534a --- /dev/null +++ b/test/runtime/samples/component-slot-let-static/Nested.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/runtime/samples/component-slot-let-static/_config.js b/test/runtime/samples/component-slot-let-static/_config.js new file mode 100644 index 0000000000..3067939b88 --- /dev/null +++ b/test/runtime/samples/component-slot-let-static/_config.js @@ -0,0 +1,3 @@ +export default { + html: `

Hi

` +}; diff --git a/test/runtime/samples/component-slot-let-static/main.html b/test/runtime/samples/component-slot-let-static/main.html new file mode 100644 index 0000000000..6e91b0d026 --- /dev/null +++ b/test/runtime/samples/component-slot-let-static/main.html @@ -0,0 +1,7 @@ + + + +

{value}

+
\ No newline at end of file