-
Notifications
You must be signed in to change notification settings - Fork 167
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
Set segmentFormat text color to black when creating the model of the clipboard content and using Keep source formatting paste type #2773
Conversation
// When using normal paste (Keep source formatting) set the default text color to black when creating the | ||
// Model from the clipboard content, so the elements that do not contain any text color in their style | ||
// Are set to black. Otherwise, These segments would get the selected segments format or the default text set in the content. | ||
result.textColor = BlackColor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if result already has textColor, will it be overwritten here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it will be overwritten.
result variable should be the current pending format of the selection, so we want to prevent that color from being applied to the content in the clipboard without any textColor style.
But only when using Keep source formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
* image-selection * fixes * safari fix * fix drag and drop * fixes * fixes * Add `<del>` elements to default processors and use knownElementProcessor for this type of element. (#2770) * init * Use alphabet order * Dont remove the MarginTop/Bottom from lists when pasting from Word Online (#2778) * init * remove unneeded function * try fix build * Reconcile table and image selection for cache (#2714) * Improve cache * fix build * improve * add test * Cache and entity 2 * Add test * Reconcile table and image selection for cache * support reconcile entity delimiter * fix build * add test --------- Co-authored-by: Bryan Valverde U <[email protected]> * Set segmentFormat text color to black when creating the model of the clipboard content and using Keep source formatting paste type (#2773) * init * add a link to tests and make sure it is handled correctly * fixes image in tables * Bump webpack from 5.84.1 to 5.94.0 (#2780) Bumps [webpack](https://github.com/webpack/webpack) from 5.84.1 to 5.94.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](webpack/webpack@v5.84.1...v5.94.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Resolve null sheet in convertInlineCss (#2784) * init * update * Update paste code to add a paragraph when the clipboard contains atleast a block element (#2777) * init * add a link to tests and make sure it is handled correctly * init * try fix build * fix build * Fix 300391: [Mail] The numbers will become a continuous sequence after typing enter at the last line of the numbering above (#2782) Co-authored-by: Bryan Valverde U <[email protected]> * Pressing Tab inside a table should select all node contents of the next cell (#2764) * normalise position * revert * empty cell check * select using children * fix tests * fix --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Julia Roldi (from Dev Box) <[email protected]> Co-authored-by: Julia Roldi <[email protected]> Co-authored-by: Bryan Valverde U <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andres-CT98 <[email protected]>
* image-selection * fixes * safari fix * fix drag and drop * fixes * fixes * Add `<del>` elements to default processors and use knownElementProcessor for this type of element. (#2770) * init * Use alphabet order * Dont remove the MarginTop/Bottom from lists when pasting from Word Online (#2778) * init * remove unneeded function * try fix build * Reconcile table and image selection for cache (#2714) * Improve cache * fix build * improve * add test * Cache and entity 2 * Add test * Reconcile table and image selection for cache * support reconcile entity delimiter * fix build * add test --------- Co-authored-by: Bryan Valverde U <[email protected]> * Set segmentFormat text color to black when creating the model of the clipboard content and using Keep source formatting paste type (#2773) * init * add a link to tests and make sure it is handled correctly * fixes image in tables * Bump webpack from 5.84.1 to 5.94.0 (#2780) Bumps [webpack](https://github.com/webpack/webpack) from 5.84.1 to 5.94.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](webpack/webpack@v5.84.1...v5.94.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Resolve null sheet in convertInlineCss (#2784) * init * update * Update paste code to add a paragraph when the clipboard contains atleast a block element (#2777) * init * add a link to tests and make sure it is handled correctly * init * try fix build * fix build * Fix 300391: [Mail] The numbers will become a continuous sequence after typing enter at the last line of the numbering above (#2782) Co-authored-by: Bryan Valverde U <[email protected]> * Pressing Tab inside a table should select all node contents of the next cell (#2764) * normalise position * revert * empty cell check * select using children * fix tests * fix * Bump version to 9.10.0 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Julia Roldi (from Dev Box) <[email protected]> Co-authored-by: Julia Roldi <[email protected]> Co-authored-by: Bryan Valverde U <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andres-CT98 <[email protected]>
Right now, if we paste some content in the editor and we use the Keep source formatting or normal paste type.
If the default format is different that black, that color will be set to the elements that do not have any text color in the HTML.
Which causes inconsistencies with the content.
To fix, if the paste type is of type normal or keep source formatting. Set the text color in the default format that is going to be used to generate the model from the clipboard content to black. That way if the element does not have a text color set we just default to black.
If the paste type is different than Keep source format, there is no need to do this, as we will merge all the format anyway.
Source
Before
After
https://outlookweb.visualstudio.com/Outlook%20Web/_workitems/edit/288926/