fix determing whether an attribute should prevent innerHTML optimization

Fixes #1581
pull/1586/head
Conduitry 6 years ago
parent 2edc56b919
commit 909536dac9

@ -152,8 +152,14 @@ export default class Element extends Node {
);
this.attributes.forEach(attr => {
if (attr.dependencies.size) {
if (
attr.chunks &&
attr.chunks.length &&
(attr.chunks.length > 1 || attr.chunks[0].type !== 'Text')
) {
this.parent.cannotUseInnerHTML();
}
if (attr.dependencies.size) {
block.addDependencies(attr.dependencies);
// special case — <option value={foo}> — see below

@ -0,0 +1,5 @@
export default {
html: `
<div><div title='foo'>bar</div></div>
`,
};

@ -0,0 +1 @@
<div><div title={'foo'}>bar</div></div>
Loading…
Cancel
Save