Set quote_mark to null when closing quote mark is found

pull/2754/head
Emil Tholin 5 years ago
parent fbb6c9fd4e
commit 97184b789c

@ -122,7 +122,7 @@ function get_style_value(chunks: Node[]) {
} else if (char === '\\') {
escaped = true;
} else if (char === quote_mark) {
quote_mark === null;
quote_mark = null;
} else if (char === '"' || char === "'") {
quote_mark = char;
} else if (char === ')' && in_url) {
@ -173,4 +173,4 @@ function get_style_value(chunks: Node[]) {
function is_dynamic(value: Node[]) {
return value.length > 1 || value[0].type !== 'Text';
}
}

@ -0,0 +1,8 @@
export default {
test({ assert, target }) {
const div = target.querySelector( 'div' );
assert.equal( div.style.backgroundImage, 'url(https://example.com/foo.jpg)');
assert.equal( div.style.color, 'red' );
}
};

@ -0,0 +1,6 @@
<script>
let bgImage = 'https://example.com/foo.jpg';
let color = 'red';
</script>
<div style="background-image: url('{bgImage}'); color: {color};">{color}</div>
Loading…
Cancel
Save