diff --git a/src/lib/utils/checklist.test.ts b/src/lib/utils/checklist.test.ts index f60fbec..af8a361 100644 --- a/src/lib/utils/checklist.test.ts +++ b/src/lib/utils/checklist.test.ts @@ -318,4 +318,9 @@ describe('unlinkifyHtml', () => { expect(unlinkifyHtml('<b>bold</b>')).toBe('bold'); expect(unlinkifyHtml('say "hello"')).toBe('say "hello"'); }); + + it('converts   from contenteditable to regular spaces', () => { + expect(unlinkifyHtml('hello world')).toBe('hello world'); + expect(unlinkifyHtml('a  b')).toBe('a b'); + }); }); diff --git a/src/lib/utils/checklist.ts b/src/lib/utils/checklist.ts index a10eddc..136fe44 100644 --- a/src/lib/utils/checklist.ts +++ b/src/lib/utils/checklist.ts @@ -191,6 +191,7 @@ export function unlinkifyHtml(html: string): string { if (!html) return ''; return html .replace(/<[^>]*>/g, '') + .replace(/ /g, ' ') .replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>')