-
Notifications
You must be signed in to change notification settings - Fork 158
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
Content Model: Paste plain text applies current format #2057
Merged
Conversation
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
JiuqingSong
requested review from
flyingbee2012,
BryanValverdeU,
ianeli1,
vinguyen12,
juliaroldi and
Andres-CT98
September 8, 2023 18:23
BryanValverdeU
approved these changes
Sep 8, 2023
ianeli1
added a commit
that referenced
this pull request
Sep 11, 2023
* Content Model: Improve cache behavior (#1999) * Content Model: Improve cache behavior * fix build * fix comment * Skip Trigger plugin event on plain text paste (#2011) * init * remove unneeded change * Update return type * Fix 218869: Do not allow dragging on readonly content (#2010) * Fix 218869: Do not allow dragging readonly content * fix test * Content Model: Fix 194024 and 220289 (#2012) * Content Model: Fix 221290 Support float for image (#2013) * Content Model: improve formatWithContentModel 1 (#2001) * Content Model: Improve cache behavior * fix build * Content Model: improve formatWithContentModel * Content Model: improve formatWithContentModel 2 (#2002) * Content Model: Improve cache behavior * fix build * Content Model: improve formatWithContentModel * Content Model: improve formatWithContentModel 2 * fix format * WIP * fix handles * MergeModel, do not inherit the styles of table when splitting the param (#2016) * init * init * address comment * update test names * fixes * Demo site: Fix insert link button in Content Model ribbon (#2018) * Content Model: insertEntity API (#1800) * Content Model insertEntity * improve * improve * Content Model: Improve cache behavior * fix build * Content Model: improve formatWithContentModel * Content Model: improve formatWithContentModel 2 * Improve * fix build * fix build * improve * add test * add test * add test * add test * fix dark color * fix test * fix build and test * crop * fix xase * check cell exist * Fix #1752, rename header to heading (#2020) * fix cell empty cells * fix flipped image * Update logic to decide if we need to merge a table on paste. (#2022) * Fix TableSelectionCopy * update unit tests * Fix 2 * address comment * Content Model: Rename a test file (#2029) * Fix Triple clicking a single cell selecting more than one (#2024) * fix triple click, optimisation * Remove `display: flex` style on paste (#2031) * init * Fix * Replace first cell content if input while on cell selection (#2030) * select first cell content and empty, add undo if change * Content Model: Fix 222135 (#2035) * Fix 222135 * fix build * Content Model: Fix 219312 (#2036) * Fix regression when creating the BeforePasteEvent (#2039) * init * fix build * Content Model: Fix 220050 (#2037) * Content Model: Fix 220050 * Fix build * improve * improve * Simplify the domToModel call in `paste.ts` (#2040) * add more changes * fix build * fix test * Content Model: Support vertical-align for image (#2041) * Content Model: Support vertical-align for image * fix build and test --------- Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com> * Remove deprecated colors from borders, text and background. (#2045) * Support more border styles * init * Revert unrelated change * Fix dependencies * address comments * try fix build * reselection * add space * Content Model: Improve insertEntity (#2047) * Content Model: Improve insertEntity * fix test * Content Model: Fix selection of entity (#2051) * Content Model: Always return size in pt when getFormatState (#2052) * Content Model: trigger ShadowEdit events (#2053) * Content Model: trigger ShadowEdit events * improve * Content Model: Add solid paragraph in new table cell (#2055) * Content Model: Do color transform for entity when copy/paste (#2056) * Content Model: Do color transform for entity when copy/paste * Call normalizeContentModel * Content Model: Paste plain text applies current format (#2057) * Content Model: Paste plain text applies current format * fix build * Content Model: Fix a regression of shadow edit (#2058) * Update versions * Fix double import * Double import 2 --------- Co-authored-by: Jiuqing Song <jisong@microsoft.com> Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com> Co-authored-by: Júlia Roldi <juliaroldi@microsoft.com> Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com> Co-authored-by: Andres-CT98 <107568016+Andres-CT98@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When copy some plain text and paste, since the copied text does not have any format, the paste result will totally rely on current DOM structure. Sometimes it will also paste without any format, especially when current format is specified on segment but not on paragraph.
In this change, I'm adding a format container SPAN and apply current format (font family, font size, text color, background color, letter spacing, line height) onto this SPAN and put all copied content under it. When merge, this format will take effect if it s not overwritten by other formats.