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: '', + contentAfter: '', }); }); 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: '
[]c
', + contentAfter: '[]c
', }); }); it('should insert a link and write a character a newand another character', async () => { @@ -79,7 +79,7 @@ describePlugin(Link, testEditor => { await insertParagraphBreak(editor); await insertText(editor, 'c'); }, - contentAfter: '
c[]d
', + contentAfter: 'c[]d
', }); }); it.skip('should insert a link and write a character at the end of the link then insert aalabelb
[]c
alabelb
[]c
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
', }); }); });