You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Shift+Tab in a nested blockquote inside a list item moves the quote out of the list and drops a quote level #5342
Pressing Shift+Tab inside a nested blockquote in a list item treats the quote as if it were a nested list item: the inner quote is moved out of the list into the parent bullet list, and the outer quote level is dropped. Content structure is lost (> > q becomes > q, no longer part of the list item), and the editor state ends up with a block-quote directly inside a bullet-list.
With a single-level quote (> q) Shift+Tab correctly does nothing.
No error is thrown.
Steps to Reproduce
Open a document with:
- a
> > q
Click at the end of q and press Shift+Tab.
Switch to source code mode.
Expected Behavior
Nothing happens (the caret is not in a list item paragraph), the same as for a single-level quote, and the markdown stays - a\n\n > > q.
Actual Behavior
The markdown becomes - a\n\n> q: the quote has left the list item and lost one level.
Typing z and then pressing Backspace at the start of the moved quote gives - a\n\nqz, with a bare paragraph directly inside the list in the state: bullet-list( list-item(...), paragraph ).
Screenshots / Logs
Analysis:ParagraphContent._getUnindentType() (packages/muya/src/block/content/paragraphContent/index.ts) only checks that the paragraph's great-grandparent is a list-item / task-list-item. For list-item > block-quote > block-quote > paragraph it takes the inner quote as "the list item" and the outer quote as "the list", so _unindentListItem() clones the inner quote next to the real list item and removes the outer quote. It never checks that the parent chain is actually list-item > list. Found while reviewing #4913; the behaviour is the same on develop before and after that PR.
Reproduced in the built desktop app (Playwright + Electron) and in real Chrome against the muya e2e host.
Operating System
macOS
MarkText Version
develop @ a351c50 (the code involved is unchanged since v0.20.0-rc.2)
Activity
fix(muya): only outdent a paragraph that sits in a nested list item (#…