@portabletext/editor 1.5.3 → 1.5.4

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.mjs CHANGED
@@ -3535,7 +3535,7 @@ function createWithPortableTextMarkModel(editorActor, types) {
3535
3535
  const children = Node.children(editor, path);
3536
3536
  for (const [child, childPath] of children) {
3537
3537
  const nextNode = node.children[childPath[1] + 1];
3538
- if (editor.isTextSpan(child) && editor.isTextSpan(nextNode) && isEqual(child.marks, nextNode.marks)) {
3538
+ if (editor.isTextSpan(child) && editor.isTextSpan(nextNode) && child.marks?.every((mark) => nextNode.marks?.includes(mark)) && nextNode.marks?.every((mark) => child.marks?.includes(mark))) {
3539
3539
  debug$c("Merging spans", JSON.stringify(child, null, 2), JSON.stringify(nextNode, null, 2)), editorActor.send({
3540
3540
  type: "normalizing"
3541
3541
  }), Transforms.mergeNodes(editor, {