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

Paste (insertNode) under B/I/U tag causes the inserted content has B/I/U style #456

Closed
JiuqingSong opened this issue Jul 22, 2020 · 3 comments

Comments

@JiuqingSong
Copy link
Collaborator

No description provided.

@JiuqingSong JiuqingSong self-assigned this Jul 27, 2020
@huahuahu
Copy link

Hi, any updates?

@JiuqingSong
Copy link
Collaborator Author

This needs a large redesign about how we handle the B/I/U tags. It is in our plan but may not happen very soon.
A workaround will be having a plugin to handle BeforePasteEvent, and split existing B/I/U tags if any, then put cursor out of those tags, so that pasting will work correctly in most cases. But in case B/I/U is put outside of a block node (e.g. DIV), there will still be issue.

BryanValverdeU added a commit that referenced this issue Apr 25, 2023
…1716)

In order to start using content model to insert clipboard content to the editor we need to do some refactor on some utilities:

Move the createPasteFragment logic from roosterjs-editor-core package to roosterjs-editor-dom, so we can also use the logic in roosterjs-content-model.
Add a new property to BeforePasteEvent to let other plugins modify the way we process elements in the paste fragment, this will be used later in another PR.
Create a new core api createPasteModel that will use the PasteFragment to create and return a content model document.
In the ContentModelEditor Class, override the paste function so, instead of using insertContent, use mergeModel function
Bugs that may be fixes by leveraging Content Model with this change:
#456
#1065
#1322 partially, only the paste part is fixed, copy needs to fixed in another PR.
#920
JiuqingSong added a commit that referenced this issue Apr 27, 2023
* add tests for image edit

* fix build

* Move getPasteSource from Plugins to Dom  (#1708)

* init

* try fix tests

* Content Model minor fix: Change parameter type (#1720)

* Content Model: Fix #1702 Hyperlinking a text doesnt trigger ChangeSource.CreateLink event (#1703)

* Content Model: Fix #1702

* fix build

* fix test

* fix build

* Fix #1713 (#1718)

* Fix Uncaught TypeError: Cannot read properties of undefined (reading 'parentNode') (#1725)

* Fix Unhandled exception

* fix test

* remove unneeded changes

* Decouple logic from Table Cell Selection into smaller files. (#1722)

* Refactor

* Add comment

* Allow Content Model API to remove image border (#1733)

* Modify API to allow accepting null

* New demo button

* Testing

* Content Model: Fix #1684 (#1730)

* Content Model: Improve edit plugin (#1728)

* Content Model fidelity 1: Support lineHeight in list (#1731)

* [1/3] Enable Strict mode in TableCellSelection Utils + Plugin (#1735)

Enable Strict mode in Table Cell Selection Utils and the Plugin class

* Content Model fidelity improvement 2: Support size in divider (#1732)

* Content Model fidelity 2: Support size in divider

* fix test

* Content Model: Improve default format state (#1743)

* Content Model: Improve default format state

* add a test case

* Add check for empty selectors, and empty CSS rule insertion (#1744)

* add check for empty selectors, and empty cssRule

* fix test case

* Content Model: Fix #1738 delete space issue (#1740)

* Content Model: Fix #1738 delete space issue

* enable edit plugin in demo site by default

* Fix space issue

* fix cache behavior

* Make additionalTagReplacements allow `null` value type. (#1745)

* Fix additionalTagReplacements type in HtmlSanitizerOptions.ts

* Make compiler happy

* [2/3] Enable Strict mode on KeyDown Handler (#1736)

* Table cell selection strict mode 1

* enable strict mode on handleKeyDown

* [3/3] Enable Strict mode in Mouse Down Handler + Add Strict mode files (#1737)

* Table cell selection strict mode 1

* enable strict mode on handleKeyDown

* enable strict mode on mousedown

* merge conflicts

* Change from undefined to null

* Revert "Paste as image feature" - convertPastedContentFromExcel (#1749)

* revert only convertPastedContentFromExcel.ts

* Leverage Content Model to insert the Pasted content from clipboard (#1716)

In order to start using content model to insert clipboard content to the editor we need to do some refactor on some utilities:

Move the createPasteFragment logic from roosterjs-editor-core package to roosterjs-editor-dom, so we can also use the logic in roosterjs-content-model.
Add a new property to BeforePasteEvent to let other plugins modify the way we process elements in the paste fragment, this will be used later in another PR.
Create a new core api createPasteModel that will use the PasteFragment to create and return a content model document.
In the ContentModelEditor Class, override the paste function so, instead of using insertContent, use mergeModel function
Bugs that may be fixes by leveraging Content Model with this change:
#456
#1065
#1322 partially, only the paste part is fixed, copy needs to fixed in another PR.
#920

* Don't return focus to editor when blur on image (#1742)

* Don't return focus to editor when blur on image

* Comment

* Content Model fidelity improvement 3: Block format (#1751)

* Content Model fidelity improvement 3: Block format

* improve

* fix test

* Add a experimental feature for paste with ContentModel #1758

* 8.46.0

---------

Co-authored-by: Júlia Roldi <juliaroldi@microsoft.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
Co-authored-by: Ian Elizondo <ianeli@microsoft.com>
Co-authored-by: Andres-CT98 <107568016+Andres-CT98@users.noreply.github.com>
Co-authored-by: Ruijun Gao <rckgao@gmail.com>
@BryanValverdeU
Copy link
Contributor

This should be fixed with

Experimental Feature: Paste with content model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants