@portabletext/editor 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -3490,6 +3490,17 @@ function createWithPortableTextMarkModel(editorActor, types2) {
3490
3490
  }
3491
3491
  }
3492
3492
  }
3493
+ if (atTheBeginningOfSpan && !spanIsEmpty && previousSpan) {
3494
+ slate.Transforms.insertNodes(editor, {
3495
+ _type: "span",
3496
+ _key: editorActor.getSnapshot().context.keyGenerator(),
3497
+ text: op.text,
3498
+ marks: (previousSpan.marks ?? []).filter(
3499
+ (mark) => decorators.includes(mark)
3500
+ )
3501
+ });
3502
+ return;
3503
+ }
3493
3504
  }
3494
3505
  }
3495
3506
  if (op.type === "remove_text") {