@portabletext/editor 7.10.10 → 7.10.11

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
@@ -8978,6 +8978,9 @@ function createSpanNode(context) {
8978
8978
  marks: []
8979
8979
  };
8980
8980
  }
8981
+ function isCosmeticNormalizationSkipped(editor) {
8982
+ return editor.isProcessingRemoteChanges;
8983
+ }
8981
8984
  const normalizeNode = (editor, entry) => {
8982
8985
  const [node, path2] = entry, nodeRecord = node;
8983
8986
  if (isEditor(node) && node.snapshot.context.value.length === 0) {
@@ -8986,7 +8989,7 @@ const normalizeNode = (editor, entry) => {
8986
8989
  });
8987
8990
  return;
8988
8991
  }
8989
- if (isTextBlock({
8992
+ if (!isCosmeticNormalizationSkipped(editor) && isTextBlock({
8990
8993
  schema: editor.snapshot.context.schema
8991
8994
  }, node)) {
8992
8995
  const children = getChildren(editor.snapshot, path2);
@@ -9302,7 +9305,9 @@ const normalizeNode = (editor, entry) => {
9302
9305
  }, child)) {
9303
9306
  if (prev != null && isSpan({
9304
9307
  schema: editor.snapshot.context.schema
9305
- }, prev)) {
9308
+ }, prev) && // Only this merge/empty-drop arm is cosmetic; the inline-object
9309
+ // bracketing below is a repair and keeps running.
9310
+ !isCosmeticNormalizationSkipped(editor)) {
9306
9311
  if (child.text === "") {
9307
9312
  editor.apply({
9308
9313
  type: "unset",