Also fixes `Editor.positions` bug #3458 that was fixed in parallel in #4073,
but includes refactorings as discussed in #3644.
vs #3458
- Updated to include changes from later PRs (#3957)
- Does not add test cases (relies on those from #4073)
- Minor improvements on comments
* Defined conditions to always split nodes
Those conditions are:
- When the anchor does not lie at the start of a node.
- When the focus does not lie at the end of a node.
* prev variable now points to correct updated node.
Previously, in the case the previous node gets merged in last iteration,
prev pointer could be pointing to the wrong node.
That posed problems, especially when normalizing empty text nodes.
So, now in every iteration, we get a copy of updated node structure,
and take value of prev from that.
* Test to check splitting and normalization logic.
- In this, since anchor and focus bleeds on both sides, splits happen.
- Empty text nodes are introduced on either side.
- New properties are set in the new node selection.
- Normalization happens and takes care of those empty text nodes.
* Create two-lies-appear.md
* Update two-lies-appear.md
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
* Save some remove_text calls if the text is zero length.
* Remove unnecessary !text check - text is always string, and add similar check to 'insert_text' as well
* Create giant-adults-matter.md
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
* Use null instead of undefined as the old value for set_node operations that add a property
* Changelog
* Omit undefined values from `set_node` operations completely. Delete missing property values in `Transforms.apply()` instead.
* Add tests for removing set_node properties with null and undefined
* fix ime double when apply mark
* add changeset
* refactor to use auto-incrementing key and add comments for it
* Update lovely-walls-knock.md
* Update lovely-walls-knock.md
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
* feat: sync selection to extractly dom selection
* revert mistakenly modified files
* add changeset
* toSlatePoint will throw error again when not extractMatch
* Fix misspellings, rename extractMatch to exactMatch
* rename option to match code style
* Update four-poets-move.md
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>