Skip to content

fix(muya): only outdent a paragraph that sits in a nested list item (#5342) - #5345

Merged
Jocs merged 1 commit into
developfrom
fix/5342-outdent-list-chain
Sep 14, 2026
Merged

Jocs merged 1 commit into
developfrom
fix/5342-outdent-list-chain

Conversation

@Jocs

@Jocs Jocs commented Sep 14, 2026

Copy link
Copy Markdown
Member

Closes #5342

Summary

Shift+Tab decided whether to outdent by checking only that the caret paragraph's great-grandparent was a list item. A paragraph in list item > block-quote > block-quote passes that check too, so _unindentListItem() treated the inner quote as "the list item" and the outer quote as "the list": the inner quote was moved into the outer list and the outer quote level was dropped.

_getUnindentType() now requires the full chain paragraph > (list-item | task-list-item) > (bullet-list | order-list | task-list) > (list-item | task-list-item). Anything else returns null, and tabHandler then does nothing — exactly what already happens for a single-level quote in a list item (preventDefault is still called first, so focus doesn't move).

Real Chrome (muya e2e host), click at the end of the target paragraph, Shift+Tab, type z:

Document develop this PR
- a / > > q - a\n\n> qz — quote left the list, one level lost - a\n\n > > qz (unchanged)
- a / - b / > > q - a\n - b\n\n > qz — quote moved into the outer item's sublist unchanged
> - a / > > > q > - a\n>\n> > qz unchanged
- a / > q (control) unchanged unchanged
- a / - b (positive control) - a\n- bz - a\n- bz
- [ ] a / - [ ] b (positive control) - [ ] a\n- [ ] bz - [ ] a\n- [ ] bz

No renderer errors in either run. _canIndentListItem() (Tab) already checks that the paragraph's parent is a list item, so Tab inside a nested quote keeps inserting spaces.

Type of change

  • Bug fix (non-breaking, fixes an issue)
  • New feature (non-breaking, adds functionality)
  • Breaking change (causes existing functionality to change)
  • Documentation update

Test plan

Notes for reviewers [optional]

Out of scope, found while auditing the indent paths: Tab (_indentListItem) appends the item into the previous item's last sublist without checking the item type, so - [ ] a / - b / - [ ] c + Tab on c puts a task-list-item into a bullet-list (and the reverse). That is the same item-type mismatch as #5341, in the indent direction.


By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KGKDSxyPk9WxU2h5DgPcWn

…5342)

Shift+Tab decided whether to outdent by checking only that the paragraph's
great-grandparent was a list item. A paragraph in `list item > block-quote >
block-quote` passed that check, so `_unindentListItem` treated the inner quote
as the list item and the outer quote as the list: the inner quote was moved
into the outer bullet list and the outer quote level was dropped
(`- a` / `  > > q` became `- a` / `> q`).

Require the full chain `paragraph > list item > list > list item`; anything
else is a no-op, the same as a single-level quote in a list item already was.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01KGKDSxyPk9WxU2h5DgPcWn
@Jocs
Jocs merged commit 991cabd into develop Sep 14, 2026
7 checks passed
@Jocs
Jocs deleted the fix/5342-outdent-list-chain branch September 14, 2026 08:11
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.

[Bug] Shift+Tab in a nested blockquote inside a list item moves the quote out of the list and drops a quote level

1 participant