Skip to content

Commit 8287ed3

Browse files
committed
fix flyne bug
1 parent 9067eb9 commit 8287ed3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/lib/tiptap/text.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,17 @@ export function optimise(arr: StringyMCText[], lore = false): StringyMCText[] {
423423
const first = extras.shift()
424424
let merged;
425425
if (typeof first == "string") {
426-
merged = { ...sharedAll, text: first, extra: extras };
426+
if (extras[0]) {
427+
merged = { ...sharedAll, text: first, extra: extras };
428+
} else {
429+
merged = { ...sharedAll, text: first };
430+
}
427431
} else {
428-
merged = { ...sharedAll, ...first, extra: extras };
432+
if (extras[0]) {
433+
merged = { ...sharedAll, ...first, extra: extras };
434+
} else {
435+
merged = { ...sharedAll, ...first };
436+
}
429437
}
430438
out.splice(i, group.length, merged);
431439
i--; // recheck at this position

0 commit comments

Comments
 (0)