Skip to content

Return false for Shift+Tab outdent when only when segment before marker are spaces. - #3474

Merged
Bryan Valverde U (BryanValverdeU) merged 5 commits into
masterfrom
u/bvalverde/fixTabOutdentWithEntity
Oct 16, 2026
Merged

Bryan Valverde U (BryanValverdeU) merged 5 commits into
masterfrom
u/bvalverde/fixTabOutdentWithEntity

Conversation

@BryanValverdeU

Copy link
Copy Markdown
Contributor

handleTabOnParagraph previously fell through without returning false when the segment immediately before the collapsed selection marker was not a Text segment (e.g. an Entity), causing preventDefault() to be called without actually outdenting. Now it checks whether all segments before the marker are entities and returns false so the browser's default Shift+Tab behavior runs.

Before
shiftTabBefore

After
shiftTabAfter

handleTabOnParagraph previously fell through without returning false when the
segment immediately before the collapsed selection marker was not a Text
segment (e.g. an Entity), causing preventDefault() to be called without
actually outdenting. Now it checks whether all segments before the marker are
entities and returns false so the browser's default Shift+Tab behavior runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a6a96dae-ddfc-4128-974c-c3d69eba91d2
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-16 17:31 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The narrow guard matches the intended behavior, preserves text outdenting, and includes regression coverage.

0 open findings

What changed in this PR

Fixes Shift+Tab handling in RoosterJS so the browser’s default behavior runs when only entities precede a collapsed selection marker.

Changes:

  • Returns false for entity-only segments before the marker.
  • Adds a regression test for this case.
File Description
packages/​roosterjs-content-model-plugins/​test/​edit/​tabUtils/​handleTabOnParagraphTest.ts Tests the entity-only Shift+Tab fallback.
packages/​roosterjs-content-model-plugins/​lib/​edit/​tabUtils/​handleTabOnParagraph.ts Adds the guard allowing default browser behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a6a96dae-ddfc-4128-974c-c3d69eba91d2
@BryanValverdeU Bryan Valverde U (BryanValverdeU) changed the title Return false for Shift+Tab outdent when only entities precede the marker Return false for Shift+Tab outdent when only when segment before marker are spaces. Oct 14, 2026
…TabOnParagraphTest

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a6a96dae-ddfc-4128-974c-c3d69eba91d2
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2253ec0d-4994-4f43-b8f7-bead705407aa
Preserve the cross-browser PowerPoint paste expectation when resolving the test conflict.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2253ec0d-4994-4f43-b8f7-bead705407aa
@BryanValverdeU
Bryan Valverde U (BryanValverdeU) merged commit b07b322 into master Oct 16, 2026
8 checks passed
Julia Roldi (juliaroldi) added a commit that referenced this pull request Oct 16, 2026
* Bump fast-uri from 3.1.6 to 3.1.8 (#3467)

Bumps [fast-uri](https://github.com/fastify/fast-uri) from 3.1.6 to 3.1.8.
- [Release notes](https://github.com/fastify/fast-uri/releases)
- [Commits](fastify/fast-uri@v3.1.6...v3.1.8)

---
updated-dependencies:
- dependency-name: fast-uri
  dependency-version: 3.1.8
  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 Word Desktop nested list spacing (#3469)

* Fix Word Desktop nested list spacing

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

Copilot-Session: 12a1ef28-2e75-4648-a2a2-c149b4436919

* Fix Word list margin shorthand parsing

Parse margin shorthand by top-level whitespace so CSS function values such as calc() and var() are preserved when removing horizontal Word list margins.

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

Copilot-Session: 12a1ef28-2e75-4648-a2a2-c149b4436919

---------

Copilot-Session: 12a1ef28-2e75-4648-a2a2-c149b4436919

* Fix borders being incorrectly applied when pasting tables from Word Desktop (#3470)

* Handle Word table no-border paste

Add a Word Desktop border parser that reads the original style attribute and preserves explicit border:none declarations by clearing the corresponding table border formats.

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

Copilot-Session: 12a1ef28-2e75-4648-a2a2-c149b4436919

* Use 'none' instead of empty string for no-border values in Word table paste

Fix unit tests for addParser call counts after adding wordBorderParser

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fc13a30a-b68a-4db8-a3eb-c057f2195fe4

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 12a1ef28-2e75-4648-a2a2-c149b4436919
Copilot-Session: fc13a30a-b68a-4db8-a3eb-c057f2195fe4

* Fix list bullet font size using stale font from previous element (#3471)

Root cause:
When pasting a Word list item with no Word fake-bullet markup (i.e. no
mso-list:Ignore span), processAsListItem created the list item's format
holder (used to render the bullet/number) from context.segmentFormat
*before* parsing the current list item element's own font family/size
into it. This meant the first list item's bullet font came from
whatever was left over from the previously processed element, instead
of the list item's own style.

Fix:
Parse the list item element's own segment format into
context.segmentFormat before creating the list item, so the format
holder always reflects the current list item's own resolved font.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fc13a30a-b68a-4db8-a3eb-c057f2195fe4

* Pin GitHub Actions to full-length commit SHAs (#3472)

* Fix unsafe URL handling and HTML sanitization (#3475)

Add a shared isUnsafeUrl helper and use it in link insertion, link format parsing/application, HTML sanitization, and paste link parsing to reject script protocols obfuscated with browser-ignored characters while preserving safe URLs containing similar text. Handle SVG anchor URLs during paste, remove xmp from allowed tags to avoid unsafe raw-text serialization, and restrict sanitizer map lookups to own properties so inherited object members cannot break HTML conversion. Add regression tests for URL normalization and HTML sanitization.

* Version bump to main 9.61.0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 434dcda2-329b-46d3-9de3-48554356e678

* Return false for Shift+Tab outdent when only when segment before marker are spaces. (#3474)

* Return false for Shift+Tab outdent when only entities precede the marker

handleTabOnParagraph previously fell through without returning false when the
segment immediately before the collapsed selection marker was not a Text
segment (e.g. an Entity), causing preventDefault() to be called without
actually outdenting. Now it checks whether all segments before the marker are
entities and returns false so the browser's default Shift+Tab behavior runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a6a96dae-ddfc-4128-974c-c3d69eba91d2

* Simplify entity-before-marker check to generic non-Text fallback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a6a96dae-ddfc-4128-974c-c3d69eba91d2

* Fix test type error: provide valid ContentModelEntity shape in handleTabOnParagraphTest

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a6a96dae-ddfc-4128-974c-c3d69eba91d2

* Fix browser-dependent font expectation in PowerPoint paste test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2253ec0d-4994-4f43-b8f7-bead705407aa

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a6a96dae-ddfc-4128-974c-c3d69eba91d2
Copilot-Session: 2253ec0d-4994-4f43-b8f7-bead705407aa

---------

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>
Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Dan Fiedler <151573964+danfiedler-msft@users.noreply.github.com>
Copilot-Session: 12a1ef28-2e75-4648-a2a2-c149b4436919
Copilot-Session: fc13a30a-b68a-4db8-a3eb-c057f2195fe4
Copilot-Session: 434dcda2-329b-46d3-9de3-48554356e678
Copilot-Session: a6a96dae-ddfc-4128-974c-c3d69eba91d2
Copilot-Session: 2253ec0d-4994-4f43-b8f7-bead705407aa
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.

4 participants