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

ContentModeEditPlugin causes space to be deleted #1738

Closed
JiuqingSong opened this issue Apr 19, 2023 · 0 comments
Closed

ContentModeEditPlugin causes space to be deleted #1738

JiuqingSong opened this issue Apr 19, 2023 · 0 comments
Assignees

Comments

@JiuqingSong
Copy link
Collaborator

  1. Enable ContentModelEditPlugin
  2. Type "a b"
  3. Press Backspace

Expect: show "a "
Actual: show "a"

This is because the last space is actual a \u0020, which is not shown for HTML. We need to convert it into  

@JiuqingSong JiuqingSong self-assigned this Apr 19, 2023
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>
JiuqingSong added a commit that referenced this issue Jun 16, 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:

* 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>
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

No branches or pull requests

1 participant