mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 17:30:59 +01:00
fix determing whether an attribute should prevent innerHTML optimization
Fixes #1581
This commit is contained in:
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…
Reference in New Issue
Block a user