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 lines = await page.$$('page-editor .inline-editor');
|
||||||
const contents = await Promise.all(lines.map(el => el.innerText()));
|
const contents = await Promise.all(lines.map(el => el.innerText()));
|
||||||
content = contents
|
content = contents
|
||||||
.map(c => c.replace(/\u200B/g, '').trim())
|
.map(c => c.replace(/[\u200B-\u200D\uFEFF]/g, '').trim())
|
||||||
.filter(c => !!c)
|
.filter(c => !!c)
|
||||||
.join('\n');
|
.join('\n');
|
||||||
if (!content) {
|
if (!content) {
|
||||||
@@ -43,7 +43,9 @@ export class EditorUtils {
|
|||||||
const edgelessNode = await page.waitForSelector(
|
const edgelessNode = await page.waitForSelector(
|
||||||
'affine-edgeless-note .edgeless-note-page-content'
|
'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) {
|
public static async switchToEdgelessMode(page: Page) {
|
||||||
|
|||||||
Reference in New Issue
Block a user