mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
5830bce72c
The `Transaction.pushReplace` method has a corner case if the removed region has metadata and the inserted region is empty. This works fine unless there are two adjacent `pushReplace` operations, which can occur in `Transaction.newFromUnwrap`. Fix this by having `pushReplace` look at a preceding replace and correctly merge the two operations if possible (in particular in the tricky case where the previous case has a zero-length insertion). Pleasantly, this can be done without a lot of special-casing code in `pushReplace` or `newFromUnwrap`. Add test cases verifying the `newFromUnwrap` works correctly (both in commit and in rollback) when there is metadata present. Change-Id: I6cfec0d2b1823dad724422f018a3c73dc0c7f186 |
||
---|---|---|
.. | ||
ce | ||
dm | ||
init | ||
ui | ||
example.png | ||
index.php | ||
ve.BranchNode.test.js | ||
ve.Document.test.js | ||
ve.Element.test.js | ||
ve.Factory.test.js | ||
ve.LeafNode.test.js | ||
ve.Node.test.js | ||
ve.qunit.js | ||
ve.Range.test.js | ||
ve.test.js | ||
ve.test.utils.js |