@ckeditor/ckeditor5-engine 47.6.0 → 47.6.1-alpha.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-engine",
3
- "version": "47.6.0",
3
+ "version": "47.6.1-alpha.1",
4
4
  "description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.",
5
5
  "keywords": [
6
6
  "wysiwyg",
@@ -24,7 +24,7 @@
24
24
  "type": "module",
25
25
  "main": "src/index.js",
26
26
  "dependencies": {
27
- "@ckeditor/ckeditor5-utils": "47.6.0",
27
+ "@ckeditor/ckeditor5-utils": "47.6.1-alpha.1",
28
28
  "es-toolkit": "1.39.5"
29
29
  },
30
30
  "author": "CKSource (http://cksource.com/)",
@@ -645,7 +645,20 @@ function handlePartialMarkerOperations(operations) {
645
645
  // `markerOps.get( op.name )` must exist because original marker operation is always before partial marker operations.
646
646
  // If the original marker operation was changed to `NoOperation`, then the partial marker operations would be changed
647
647
  // to `NoOperation` as well, so this is not a case.
648
- markerOps.get(op.name).ranges.push(op.newRange);
648
+ const partialRanges = markerOps.get(op.name).ranges;
649
+ // `refRange` is the range coming from the original operation.
650
+ const refRange = partialRanges[0];
651
+ // Filter out ranges that are inside the reference range.
652
+ //
653
+ // We don't need to combine them, as the reference range already includes `op.newRange`. At the same time, the method
654
+ // `ModelRange._createFromRanges()` (which we use later on) prohibits passing intersecting ranges and works incorrectly when
655
+ // such array of ranges is passed.
656
+ //
657
+ // Note, that there cannot be a situation where these ranges intersect but are not contained.
658
+ //
659
+ if (!refRange.containsRange(op.newRange, true)) {
660
+ partialRanges.push(op.newRange);
661
+ }
649
662
  }
650
663
  operations.splice(i, 1);
651
664
  i--;