diff --git a/packages/plugin-dom-layout/src/DomReconciliationEngine.ts b/packages/plugin-dom-layout/src/DomReconciliationEngine.ts index 1642d70c8..79c04f1be 100644 --- a/packages/plugin-dom-layout/src/DomReconciliationEngine.ts +++ b/packages/plugin-dom-layout/src/DomReconciliationEngine.ts @@ -817,7 +817,7 @@ export class DomReconciliationEngine { for (const name in oldAttributes) { const value = oldAttributes[name] || ''; - if (!newAttributes[name]) { + if (typeof newAttributes[name] !== 'string') { hasChanged = true; if (name === 'style') { const oldStyle = styleToObject(value); diff --git a/packages/plugin-link/test/Link.test.ts b/packages/plugin-link/test/Link.test.ts index 5a60b37cf..0ad587eb2 100644 --- a/packages/plugin-link/test/Link.test.ts +++ b/packages/plugin-link/test/Link.test.ts @@ -35,7 +35,7 @@ describePlugin(Link, testEditor => { stepFunction: async editor => { await insertLink(editor); }, - contentAfter: '

alabel[]c

', + contentAfter: '

alabel[]c

', }); }); it('should insert a link and write a character at the end of the link', async () => { @@ -45,7 +45,7 @@ describePlugin(Link, testEditor => { await insertLink(editor); await insertText(editor, 'b'); }, - contentAfter: '

alabelb[]c

', + contentAfter: '

alabelb[]c

', }); }); it('should write two characters in the link', async () => { @@ -56,7 +56,7 @@ describePlugin(Link, testEditor => { await insertText(editor, 'b'); await insertText(editor, 'c'); }, - contentAfter: '

alabelbc[]d

', + contentAfter: '

alabelbc[]d

', }); }); it('should insert a link and write a character at the end of the link then create a new

', async () => { @@ -67,7 +67,7 @@ describePlugin(Link, testEditor => { await insertText(editor, 'b'); await insertParagraphBreak(editor); }, - contentAfter: '

alabelb

[]c

', + contentAfter: '

alabelb

[]c

', }); }); it('should insert a link and write a character a new

and another character', async () => { @@ -79,7 +79,7 @@ describePlugin(Link, testEditor => { await insertParagraphBreak(editor); await insertText(editor, 'c'); }, - contentAfter: '

alabelb

c[]d

', + contentAfter: '

alabelb

c[]d

', }); }); it.skip('should insert a link and write a character at the end of the link then insert a
', async () => { @@ -90,7 +90,7 @@ describePlugin(Link, testEditor => { await insertText(editor, 'b'); await insertLineBreak(editor); }, - contentAfter: '

alabelb
[]
c

', + contentAfter: '

alabelb
[]
c

', }); }); it.skip('should insert a link and write a character insert a
and another character', async () => { @@ -102,7 +102,7 @@ describePlugin(Link, testEditor => { await insertLineBreak(editor); await insertText(editor, 'c'); }, - contentAfter: '

alabelb
c[]
d

', + contentAfter: '

alabelb
c[]
d

', }); }); }); @@ -113,7 +113,7 @@ describePlugin(Link, testEditor => { stepFunction: async editor => { await convertToLink(editor); }, - contentAfter: '

abc[]d

', + contentAfter: '

abc[]d

', }); }); it('should set the link on two existing characters, loose range and add a character', async () => { @@ -123,7 +123,7 @@ describePlugin(Link, testEditor => { await convertToLink(editor); await insertText(editor, 'd'); }, - contentAfter: '

abcd[]e

', + contentAfter: '

abcd[]e

', }); }); });