Skip to content

Conversation

@JiuqingSong
Copy link
Collaborator

Sometimes when paste some content that has styles on paragraph, it is hard to remove those styles. This change handles delete operation, and at the last, check if nothing is deleted, try to delete styles on current paragraph if any, so that those styles can be deleted.

deleteparagraphstyle

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #3087 by implementing a solution to delete paragraph styles when no other content can be deleted. The change addresses cases where pasted content with paragraph styles becomes difficult to remove by adding a final delete step that clears paragraph formatting when the paragraph is effectively empty.

  • Adds a new deleteParagraphStyle function as the final step in the delete operation pipeline
  • Updates all existing test cases to include the new delete step in their expected step arrays
  • Provides comprehensive test coverage for the new paragraph style deletion logic

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
keyboardDelete.ts Adds the deleteParagraphStyle import and includes it as the final step in the delete steps array
deleteParagraphStyle.ts Implements the core logic to delete paragraph styles when nothing else can be deleted and the paragraph is effectively empty
deleteParagraphStyleTest.ts Provides comprehensive unit tests covering various scenarios for the new paragraph style deletion functionality
keyboardDeleteTest.ts Updates all existing test cases to include deleteParagraphStyle in their expected delete steps arrays

JiuqingSong and others added 4 commits July 22, 2025 10:02
…deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@JiuqingSong JiuqingSong merged commit 82f0466 into master Jul 23, 2025
7 checks passed
@JiuqingSong JiuqingSong deleted the u/jisong/3087 branch July 23, 2025 01:28
BryanValverdeU added a commit that referenced this pull request Jul 31, 2025
* Fix toggling format issue at composition stage for CJK (#3064)

* draft

* temp

* update ff

* update

* test

* update

* Avoid "undefined" in HTML to Markdown generated content (#3069)

* fix: avoid "undefined" before paragraphs content

* fix: set "image" as the default alt value instead of "undefined"

---------

Co-authored-by: Francois Dursus <fdursus@veson.com>

* Add focus handling in formatTableWithContentModel and its tests (#3072)

* format applier (#3073)

* Keep implicit paragraph when pressing Enter at the start of it. (#3075)

* Enhance splitParagraph function to allow preservation of implicit paragraphs after split

* Fix preserveImplicitParagraph flag in handleEnterOnParagraph to false

* Update packages/roosterjs-content-model-plugins/lib/edit/utils/splitParagraph.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add beforeLogicalRootChanged event handling and related tests (#3077)

* Add beforeLogicalRootChanged event handling and related tests

* Rename event type from 'beforeLogicalRootChanged' to 'beforeLogicalRootChange' across relevant files

* Update packages/roosterjs-content-model-types/lib/event/LogicalRootChangedEvent.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Disable isComposing check in DOM event propagation for Android (#3076)

* dsiable isComposing check for Android

* add test

---------

Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Allow plugins to store state in snapshot (#3079)

* Allow plugins to store custom state in undo snapshots

* Type fixes

* Move to using object instead array

* Fix #3080 (#3084)

* Add auto direction to setDirection (#3082)

* Initial commit

* Pending changes exported from your codespace

* fix code and tests

* Address comments

---------

Co-authored-by: wisaulni <wisaulni@microsoft.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Ensure image is loaded before creating image wrapper (#3090)

* Enhance image loading handling in ImageEditPlugin to support resizing and editing of images not fully loaded

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* test (#3092)

* Fix #3085 (#3095)

Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>

* Adjust the image wrapper to stay inline  (#3093)

Use text-bottom instead of bottom for vertical-align to prevent the image to rotate below the text line. Also add some 5px in margin bottom to compensate for the height of the bottom handles.

* Fix 309357 (#3097)

* Fix 309357

* improve

* improve

* improve

* Update packages/roosterjs-content-model-types/lib/context/ModelToDomOption.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-types/lib/context/ModelToDomSettings.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix build

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Fix #3063 (#3096)

* Fix #3087 Delete paragraph styles when there is nothing else to be deleted (#3094)

* Fix #3087

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove karma changes  (#3102)

* karma

* change

* Adjust Block Indentation (#3099)

When inserting a list or table in an indented segment, add the indentation to the block.

* Process non-visible elements (#3089)

New parameter processNonVisibleElements has been added to the DomToModelSettings and DomToModelOptions, allowing optional processing of non-visible elements.

* Fix runtime color for dark mode (#3101)

* Fix runtime color for dark mode

* add test

* fix build

* table rtl (#3103)

The style direction: RTL does move the table to the right, so use justifySelf:flex-end.

* image-handles (#3104)

When rotating an image, the resize handles direction must be updated according to the rotation angle.

* Fix superscript rule  (#3106)

* Update main version to 9.33.0 and remove overrides

* Bump adapter

* Fix 380860 (#3107)

---------

Co-authored-by: Haowen Chen <haowchen@microsoft.com>
Co-authored-by: François Dursus <francois.dursus@gmail.com>
Co-authored-by: Francois Dursus <fdursus@veson.com>
Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Rain-Zheng <67583056+Rain-Zheng@users.noreply.github.com>
Co-authored-by: florian-msft <87671048+florian-msft@users.noreply.github.com>
Co-authored-by: Jiuqing Song <jisong@microsoft.com>
Co-authored-by: wisaulni <186232390+wisaulni@users.noreply.github.com>
Co-authored-by: wisaulni <wisaulni@microsoft.com>
juliaroldi added a commit that referenced this pull request Aug 15, 2025
* Fix toggling format issue at composition stage for CJK (#3064)

* draft

* temp

* update ff

* update

* test

* update

* Avoid "undefined" in HTML to Markdown generated content (#3069)

* fix: avoid "undefined" before paragraphs content

* fix: set "image" as the default alt value instead of "undefined"

---------

Co-authored-by: Francois Dursus <fdursus@veson.com>

* Add focus handling in formatTableWithContentModel and its tests (#3072)

* format applier (#3073)

* Keep implicit paragraph when pressing Enter at the start of it. (#3075)

* Enhance splitParagraph function to allow preservation of implicit paragraphs after split

* Fix preserveImplicitParagraph flag in handleEnterOnParagraph to false

* Update packages/roosterjs-content-model-plugins/lib/edit/utils/splitParagraph.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add beforeLogicalRootChanged event handling and related tests (#3077)

* Add beforeLogicalRootChanged event handling and related tests

* Rename event type from 'beforeLogicalRootChanged' to 'beforeLogicalRootChange' across relevant files

* Update packages/roosterjs-content-model-types/lib/event/LogicalRootChangedEvent.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Disable isComposing check in DOM event propagation for Android (#3076)

* dsiable isComposing check for Android

* add test

---------

Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Allow plugins to store state in snapshot (#3079)

* Allow plugins to store custom state in undo snapshots

* Type fixes

* Move to using object instead array

* Fix #3080 (#3084)

* Add auto direction to setDirection (#3082)

* Initial commit

* Pending changes exported from your codespace

* fix code and tests

* Address comments

---------

Co-authored-by: wisaulni <wisaulni@microsoft.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Ensure image is loaded before creating image wrapper (#3090)

* Enhance image loading handling in ImageEditPlugin to support resizing and editing of images not fully loaded

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* test (#3092)

* Fix #3085 (#3095)

Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>

* Adjust the image wrapper to stay inline  (#3093)

Use text-bottom instead of bottom for vertical-align to prevent the image to rotate below the text line. Also add some 5px in margin bottom to compensate for the height of the bottom handles.

* Fix 309357 (#3097)

* Fix 309357

* improve

* improve

* improve

* Update packages/roosterjs-content-model-types/lib/context/ModelToDomOption.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-types/lib/context/ModelToDomSettings.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix build

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Fix #3063 (#3096)

* Fix #3087 Delete paragraph styles when there is nothing else to be deleted (#3094)

* Fix #3087

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove karma changes  (#3102)

* karma

* change

* Adjust Block Indentation (#3099)

When inserting a list or table in an indented segment, add the indentation to the block.

* Process non-visible elements (#3089)

New parameter processNonVisibleElements has been added to the DomToModelSettings and DomToModelOptions, allowing optional processing of non-visible elements.

* Fix runtime color for dark mode (#3101)

* Fix runtime color for dark mode

* add test

* fix build

* table rtl (#3103)

The style direction: RTL does move the table to the right, so use justifySelf:flex-end.

* image-handles (#3104)

When rotating an image, the resize handles direction must be updated according to the rotation angle.

* Fix superscript rule  (#3106)

* Fix 380860 (#3107)

* Support 'HTMLFast' mode when get HTML (#3109)

* Support 'HTMLFast' mode when get HTML

* fix build and comment

* Bump tmp from 0.2.1 to 0.2.4 (#3114)

Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.1 to 0.2.4.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](raszi/node-tmp@v0.2.1...v0.2.4)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jiuqing Song <jisong@microsoft.com>

* Fix #3110 (#3113)

* Add logical root plugin and related presets; enhance event handling with capture option

* Update packages/roosterjs-content-model-plugins/lib/imageEdit/ImageEditPlugin.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update demo/scripts/controlsV2/sidePane/presets/PresetPane.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add markdown support for strikethrough

* Fix test

* Try fix unstable test (#3118)

* Support DL,DT,DD in content model (#3120)

* Support DL,DT,DD in content model

* improve

* fix build

* fix test

* Add an experimental feature for 'HTMLFast' when export html (#3121)

* Add an experimental feature for 'HTMLFast' when export html

* fix build

* versions 9.34

* bump legacy

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Haowen Chen <haowchen@microsoft.com>
Co-authored-by: François Dursus <francois.dursus@gmail.com>
Co-authored-by: Francois Dursus <fdursus@veson.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Rain-Zheng <67583056+Rain-Zheng@users.noreply.github.com>
Co-authored-by: florian-msft <87671048+florian-msft@users.noreply.github.com>
Co-authored-by: Jiuqing Song <jisong@microsoft.com>
Co-authored-by: wisaulni <186232390+wisaulni@users.noreply.github.com>
Co-authored-by: wisaulni <wisaulni@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Francis Meng <xiameng@microsoft.com>
Co-authored-by: Francis Meng <meng.francis@gmail.com>
JiuqingSong added a commit that referenced this pull request Aug 28, 2025
* Fix toggling format issue at composition stage for CJK (#3064)

* draft

* temp

* update ff

* update

* test

* update

* Avoid "undefined" in HTML to Markdown generated content (#3069)

* fix: avoid "undefined" before paragraphs content

* fix: set "image" as the default alt value instead of "undefined"

---------

Co-authored-by: Francois Dursus <fdursus@veson.com>

* Add focus handling in formatTableWithContentModel and its tests (#3072)

* format applier (#3073)

* Keep implicit paragraph when pressing Enter at the start of it. (#3075)

* Enhance splitParagraph function to allow preservation of implicit paragraphs after split

* Fix preserveImplicitParagraph flag in handleEnterOnParagraph to false

* Update packages/roosterjs-content-model-plugins/lib/edit/utils/splitParagraph.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add beforeLogicalRootChanged event handling and related tests (#3077)

* Add beforeLogicalRootChanged event handling and related tests

* Rename event type from 'beforeLogicalRootChanged' to 'beforeLogicalRootChange' across relevant files

* Update packages/roosterjs-content-model-types/lib/event/LogicalRootChangedEvent.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Disable isComposing check in DOM event propagation for Android (#3076)

* dsiable isComposing check for Android

* add test

---------

Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Allow plugins to store state in snapshot (#3079)

* Allow plugins to store custom state in undo snapshots

* Type fixes

* Move to using object instead array

* Fix #3080 (#3084)

* Add auto direction to setDirection (#3082)

* Initial commit

* Pending changes exported from your codespace

* fix code and tests

* Address comments

---------

Co-authored-by: wisaulni <wisaulni@microsoft.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Ensure image is loaded before creating image wrapper (#3090)

* Enhance image loading handling in ImageEditPlugin to support resizing and editing of images not fully loaded

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* test (#3092)

* Fix #3085 (#3095)

Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>

* Adjust the image wrapper to stay inline  (#3093)

Use text-bottom instead of bottom for vertical-align to prevent the image to rotate below the text line. Also add some 5px in margin bottom to compensate for the height of the bottom handles.

* Fix 309357 (#3097)

* Fix 309357

* improve

* improve

* improve

* Update packages/roosterjs-content-model-types/lib/context/ModelToDomOption.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-types/lib/context/ModelToDomSettings.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix build

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Fix #3063 (#3096)

* Fix #3087 Delete paragraph styles when there is nothing else to be deleted (#3094)

* Fix #3087

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove karma changes  (#3102)

* karma

* change

* Adjust Block Indentation (#3099)

When inserting a list or table in an indented segment, add the indentation to the block.

* Process non-visible elements (#3089)

New parameter processNonVisibleElements has been added to the DomToModelSettings and DomToModelOptions, allowing optional processing of non-visible elements.

* Fix runtime color for dark mode (#3101)

* Fix runtime color for dark mode

* add test

* fix build

* table rtl (#3103)

The style direction: RTL does move the table to the right, so use justifySelf:flex-end.

* image-handles (#3104)

When rotating an image, the resize handles direction must be updated according to the rotation angle.

* Fix superscript rule  (#3106)

* Fix 380860 (#3107)

* Support 'HTMLFast' mode when get HTML (#3109)

* Support 'HTMLFast' mode when get HTML

* fix build and comment

* Bump tmp from 0.2.1 to 0.2.4 (#3114)

Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.1 to 0.2.4.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](raszi/node-tmp@v0.2.1...v0.2.4)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jiuqing Song <jisong@microsoft.com>

* Fix #3110 (#3113)

* Add logical root plugin and related presets; enhance event handling with capture option

* Update packages/roosterjs-content-model-plugins/lib/imageEdit/ImageEditPlugin.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update demo/scripts/controlsV2/sidePane/presets/PresetPane.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add markdown support for strikethrough

* Fix test

* Try fix unstable test (#3118)

* add support for nested style markdowns

* move let to const

* update

* Support DL,DT,DD in content model (#3120)

* Support DL,DT,DD in content model

* improve

* fix build

* fix test

* Add an experimental feature for 'HTMLFast' when export html (#3121)

* Add an experimental feature for 'HTMLFast' when export html

* fix build

* Fix 276282 (#3125)

* Fix #3112 Delete empty block group when need (#3124)

* Fix #3112

* improve

* fix comments

* update

* remove console log

* fix regression

* update

* Do not add undo snapshot from ImageEdit plugin if image is not changed (#3127)

* Fix 377316: Skip undo snapshot when start to edit image

* improve

* fix comment

* Support different options for empty line mode in mark down (#3128)

* Support different options for empty line mode in mark down

* Fix build

* fix test

* fix test

* Fix auto link (#3129)

When the text segment already has link, do not create the link again.

* Graduate option "disableCache" (#3132)

* Graduate option "disableCache"

* Improve

* Improve handleParagraph function (#3130)

* 9.35.0

* Remove console.log added accidentally in test code (#3134)

* Toggle blockquote in Format Container (#3126)

FormatContainer can be used to other elements other than blockquotes. When toggling blockquote in format containers that are not blockquotes, search for the selected elements inside the container and only apply blockquote to theses selected elements.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Haowen Chen <haowchen@microsoft.com>
Co-authored-by: François Dursus <francois.dursus@gmail.com>
Co-authored-by: Francois Dursus <fdursus@veson.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Rain-Zheng <67583056+Rain-Zheng@users.noreply.github.com>
Co-authored-by: florian-msft <87671048+florian-msft@users.noreply.github.com>
Co-authored-by: wisaulni <186232390+wisaulni@users.noreply.github.com>
Co-authored-by: wisaulni <wisaulni@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Francis Meng <xiameng@microsoft.com>
Co-authored-by: Francis Meng <meng.francis@gmail.com>
JiuqingSong added a commit that referenced this pull request Sep 8, 2025
* Fix toggling format issue at composition stage for CJK (#3064)

* draft

* temp

* update ff

* update

* test

* update

* Avoid "undefined" in HTML to Markdown generated content (#3069)

* fix: avoid "undefined" before paragraphs content

* fix: set "image" as the default alt value instead of "undefined"

---------

Co-authored-by: Francois Dursus <fdursus@veson.com>

* Add focus handling in formatTableWithContentModel and its tests (#3072)

* format applier (#3073)

* Keep implicit paragraph when pressing Enter at the start of it. (#3075)

* Enhance splitParagraph function to allow preservation of implicit paragraphs after split

* Fix preserveImplicitParagraph flag in handleEnterOnParagraph to false

* Update packages/roosterjs-content-model-plugins/lib/edit/utils/splitParagraph.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add beforeLogicalRootChanged event handling and related tests (#3077)

* Add beforeLogicalRootChanged event handling and related tests

* Rename event type from 'beforeLogicalRootChanged' to 'beforeLogicalRootChange' across relevant files

* Update packages/roosterjs-content-model-types/lib/event/LogicalRootChangedEvent.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Disable isComposing check in DOM event propagation for Android (#3076)

* dsiable isComposing check for Android

* add test

---------

Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Allow plugins to store state in snapshot (#3079)

* Allow plugins to store custom state in undo snapshots

* Type fixes

* Move to using object instead array

* Fix #3080 (#3084)

* Add auto direction to setDirection (#3082)

* Initial commit

* Pending changes exported from your codespace

* fix code and tests

* Address comments

---------

Co-authored-by: wisaulni <wisaulni@microsoft.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Ensure image is loaded before creating image wrapper (#3090)

* Enhance image loading handling in ImageEditPlugin to support resizing and editing of images not fully loaded

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* test (#3092)

* Fix #3085 (#3095)

Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>

* Adjust the image wrapper to stay inline  (#3093)

Use text-bottom instead of bottom for vertical-align to prevent the image to rotate below the text line. Also add some 5px in margin bottom to compensate for the height of the bottom handles.

* Fix 309357 (#3097)

* Fix 309357

* improve

* improve

* improve

* Update packages/roosterjs-content-model-types/lib/context/ModelToDomOption.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-types/lib/context/ModelToDomSettings.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix build

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>

* Fix #3063 (#3096)

* Fix #3087 Delete paragraph styles when there is nothing else to be deleted (#3094)

* Fix #3087

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Remove karma changes  (#3102)

* karma

* change

* Adjust Block Indentation (#3099)

When inserting a list or table in an indented segment, add the indentation to the block.

* Process non-visible elements (#3089)

New parameter processNonVisibleElements has been added to the DomToModelSettings and DomToModelOptions, allowing optional processing of non-visible elements.

* Fix runtime color for dark mode (#3101)

* Fix runtime color for dark mode

* add test

* fix build

* table rtl (#3103)

The style direction: RTL does move the table to the right, so use justifySelf:flex-end.

* image-handles (#3104)

When rotating an image, the resize handles direction must be updated according to the rotation angle.

* Fix superscript rule  (#3106)

* Fix 380860 (#3107)

* Support 'HTMLFast' mode when get HTML (#3109)

* Support 'HTMLFast' mode when get HTML

* fix build and comment

* Bump tmp from 0.2.1 to 0.2.4 (#3114)

Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.1 to 0.2.4.
- [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md)
- [Commits](raszi/node-tmp@v0.2.1...v0.2.4)

---
updated-dependencies:
- dependency-name: tmp
  dependency-version: 0.2.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jiuqing Song <jisong@microsoft.com>

* Fix #3110 (#3113)

* Add logical root plugin and related presets; enhance event handling with capture option

* Update packages/roosterjs-content-model-plugins/lib/imageEdit/ImageEditPlugin.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update demo/scripts/controlsV2/sidePane/presets/PresetPane.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add markdown support for strikethrough

* Fix test

* Try fix unstable test (#3118)

* add support for nested style markdowns

* move let to const

* update

* Support DL,DT,DD in content model (#3120)

* Support DL,DT,DD in content model

* improve

* fix build

* fix test

* Add an experimental feature for 'HTMLFast' when export html (#3121)

* Add an experimental feature for 'HTMLFast' when export html

* fix build

* Fix 276282 (#3125)

* Fix #3112 Delete empty block group when need (#3124)

* Fix #3112

* improve

* fix comments

* update

* remove console log

* fix regression

* update

* Do not add undo snapshot from ImageEdit plugin if image is not changed (#3127)

* Fix 377316: Skip undo snapshot when start to edit image

* improve

* fix comment

* Support different options for empty line mode in mark down (#3128)

* Support different options for empty line mode in mark down

* Fix build

* fix test

* fix test

* Fix auto link (#3129)

When the text segment already has link, do not create the link again.

* Graduate option "disableCache" (#3132)

* Graduate option "disableCache"

* Improve

* Improve handleParagraph function (#3130)

* Remove console.log added accidentally in test code (#3134)

* Toggle blockquote in Format Container (#3126)

FormatContainer can be used to other elements other than blockquotes. When toggling blockquote in format containers that are not blockquotes, search for the selected elements inside the container and only apply blockquote to theses selected elements.

* Fix auto-capitalization for iOS  (#3131)

* Fix auto-capitalization for iOS by allowing browser to handle first character deletion

* Address comments

* Fix ut

* remove ipod

* lint code

* Fix RTL for Image Selection (#3136)

* image rtl

* imageEdit

* Revert "Improve handleParagraph function (#3130)" (#3137)

This reverts commit 9f8abbf.

* 9.36.0

* Apply suggestion from @Copilot

remove duplicated line

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Haowen Chen <haowchen@microsoft.com>
Co-authored-by: François Dursus <francois.dursus@gmail.com>
Co-authored-by: Francois Dursus <fdursus@veson.com>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Rain-Zheng <67583056+Rain-Zheng@users.noreply.github.com>
Co-authored-by: florian-msft <87671048+florian-msft@users.noreply.github.com>
Co-authored-by: wisaulni <186232390+wisaulni@users.noreply.github.com>
Co-authored-by: wisaulni <wisaulni@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Francis Meng <xiameng@microsoft.com>
Co-authored-by: Francis Meng <meng.francis@gmail.com>
Co-authored-by: Zander Wang <xiaozwan@outlook.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.

3 participants