Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge text node and segments #2846

Merged
merged 10 commits into from
Oct 29, 2024
Merged

Merge text node and segments #2846

merged 10 commits into from
Oct 29, 2024

Conversation

JiuqingSong
Copy link
Collaborator

@JiuqingSong JiuqingSong commented Oct 25, 2024

This change fixes two issues.

  1. When two or more continuous text segments have the same format, we can merge them into one when normalizeContentModel and normalizeParagraph
  2. When selection marker is located between two text segments that have same format, when create DOM tree, we can just create a single text node for them and remember the selection offset in context, and fixup their cached segments info.

This can solve the following problems:

  1. Make the result content model predictable after changing selections
  2. Correct the cached segments after Node.normalize() is called (https://outlookweb.visualstudio.com/Outlook%20Web/_queries/edit/309633/?triage=true)

@JiuqingSong JiuqingSong marked this pull request as ready for review October 27, 2024 15:41
@JiuqingSong JiuqingSong merged commit eeec49f into master Oct 29, 2024
7 checks passed
@JiuqingSong JiuqingSong deleted the u/jisong/mergesegments branch October 29, 2024 20:53
JiuqingSong added a commit that referenced this pull request Nov 1, 2024
* fix test

* test

* Merge text node and segments (#2846)

* Merge text segments

* Fix test

* merge node

* fix build and test

* add test

* Add test

* fix test

* Remove tablePreProcessor (#2849)

* Add change data and apiName to ContentChangedEvent when handle keyboard input (#2854)

* Change version

---------

Co-authored-by: Julia Roldi (from Dev Box) <juliaroldi@microsoft.com>
Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
BryanValverdeU added a commit that referenced this pull request Nov 15, 2024
* fix test

* test

* Merge text node and segments (#2846)

* Merge text segments

* Fix test

* merge node

* fix build and test

* add test

* Add test

* fix test

* Remove tablePreProcessor (#2849)

* Add change data and apiName to ContentChangedEvent when handle keyboard input (#2854)

* Fix #2857 (#2858)

* Revert Shortcut command for Clear Format on mac (#2834)

* revert Shortcut command for Clear Format on mac

* fix ctrl and meta can press in the same time

* update comment

* Allow browser's default paste behavior when pasting from Office Android (#2863)

* Implement shouldPreventDefaultPaste function

* fix build

* fix build

* list-bugs

* fix image floating

* Customize the behavior of merging format values (#2865)

* define types

* add callbacks

* use param instead

* fix test

---------

Co-authored-by: Jiuqing Song <jisong@microsoft.com>

* updateVersion.json

* Fix merge segment issue (#2871)

---------

Co-authored-by: Julia Roldi (from Dev Box) <juliaroldi@microsoft.com>
Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
Co-authored-by: Jiuqing Song <jisong@microsoft.com>
Co-authored-by: 庄黛淳华 <miku1958@users.noreply.github.com>
Co-authored-by: Rain-Zheng <67583056+Rain-Zheng@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants