feat: Intra-line double link interaction

This commit is contained in:
xiaodong zuo
2022-08-19 11:13:15 +08:00
parent dd1b160ef4
commit 2406f9556f
3 changed files with 57 additions and 55 deletions
@@ -597,10 +597,11 @@ class SlateUtils {
const fragmentChildren = firstFragment.children;
const textChildren: Text[] = [];
for (const child of fragmentChildren) {
if ((child as any).type === 'link') {
textChildren.push(child as Text);
const textChildren = [];
for (let i = 0; i < fragmentChildren.length; i++) {
const child = fragmentChildren[i];
if ('type' in child && child.type === 'link') {
i !== fragmentChildren.length - 1 && textChildren.push(child);
continue;
}
if (!('text' in child)) {