From 25418b402ae310e3958997b04a6c306cb6e96033 Mon Sep 17 00:00:00 2001 From: yoyoyohamapi <8338436+yoyoyohamapi@users.noreply.github.com> Date: Thu, 10 Apr 2025 11:55:30 +0000 Subject: [PATCH] =?UTF-8?q?fix(core):=20replace=20zero-width=20non-ioiner?= =?UTF-8?q?=20for=20editor=20content=E2=80=8B=20(#11591)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/affine-cloud-copilot/e2e/utils/editor-utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/affine-cloud-copilot/e2e/utils/editor-utils.ts b/tests/affine-cloud-copilot/e2e/utils/editor-utils.ts index 7ace8b9c26..9bf1ac76cd 100644 --- a/tests/affine-cloud-copilot/e2e/utils/editor-utils.ts +++ b/tests/affine-cloud-copilot/e2e/utils/editor-utils.ts @@ -28,7 +28,7 @@ export class EditorUtils { const lines = await page.$$('page-editor .inline-editor'); const contents = await Promise.all(lines.map(el => el.innerText())); content = contents - .map(c => c.replace(/\u200B/g, '').trim()) + .map(c => c.replace(/[\u200B-\u200D\uFEFF]/g, '').trim()) .filter(c => !!c) .join('\n'); if (!content) { @@ -43,7 +43,9 @@ export class EditorUtils { const edgelessNode = await page.waitForSelector( 'affine-edgeless-note .edgeless-note-page-content' ); - return (await edgelessNode.innerText()).replace(/\u200B/g, '').trim(); + return (await edgelessNode.innerText()) + .replace(/[\u200B-\u200D\uFEFF]/g, '') + .trim(); } public static async switchToEdgelessMode(page: Page) {