mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 05:47:09 +08:00
fix(core): replace zero-width non-ioiner for editor content (#11591)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user