-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(editor): fix merge spans normalisation logic
There were a couple of problems with the code before this change: 1. Merge spans normalisation would only be run on spans and as a result of specific operations. 2. Merge spans normalisation could run on spans that were already removed. Now, the normalisation logic is structured as normalisation logic would normally be structured. It's the parent block that takes care of merging spans and the normalisation is run whenever the editor deems that it's time to run normalisation. This makes sure that all spans in the editor at all times are normalised, not just those that were touched by a specific operation. This takes care of both problem (1) and (2). We now also don't run `editor.onChange()` after custom normalisation anymore. Instead, we `return` to trigger a new normalisation pass.
- Loading branch information
1 parent
7797c03
commit 763de2a
Showing
1 changed file
with
62 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters