Skip to content

[lexical-markdown] Bug Fix: block shortcuts no longer discard the enclosing block quote - #8956

Closed
LeSingh1 wants to merge 1 commit into
meta:mainfrom
LeSingh1:lexical-markdown-quote-block-shortcut
Closed

LeSingh1 wants to merge 1 commit into
meta:mainfrom
LeSingh1:lexical-markdown-quote-block-shortcut

Conversation

@LeSingh1

@LeSingh1 LeSingh1 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Typing # , ## , - or 1. at the start of an existing block quote replaced the QuoteNode with the new block, silently discarding the quote. The > and ``` shortcuts were already safe; heading and list shortcuts were not. That is broader than the report, which only mentions headings.

A QuoteNode holds inline content, so there is nowhere to nest the new block — exporting a heading nested in a quote loses the level (> H2). Import already declines: $convertFromMarkdownString('> # x') keeps the quote and leaves # x as literal text. The shortcut now agrees rather than dropping the quote out from under the caret. This mirrors the guard listReplace already has for HeadingNode.

Import is untouched (the check is gated on !isImport); only the typed-shortcut path changes.

Adds 7 tests over # , ## , ###### , 1. , - , * , + .

If you would rather the marker actually take effect inside the quote, @lexical/mdast already supports that tree shape and I have a companion change for its shortcuts — happy to send it if this direction is wrong.

Fixes #7407

…losing block quote

Typing a heading or list marker at the start of an existing quote replaced
the QuoteNode with the new block, silently dropping the quote. A QuoteNode
holds inline content, so there is nowhere to nest the new block; import
already declines and leaves the marker as literal text inside the quote, and
the shortcut now agrees. The heading transformer and listReplace both refuse
to consume a QuoteNode when running as a shortcut (import is unchanged).
@vercel

vercel Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview Aug 7, 2026 11:04am
lexical-playground Ready Ready Preview Aug 7, 2026 11:04am

Request Review

@LeSingh1

Copy link
Copy Markdown
Contributor Author

Consolidated into #9055 with the other PRs that share this defect, per @etrepum's note on #9027 and @mayrang's on #9035. Same fix and same tests, one review.

@LeSingh1 LeSingh1 closed this Aug 10, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — f50f0e95 Deployed Aug 7, 2026 by vercel[bot]
Preview – lexical-playground — f50f0e95 Deployed Aug 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Markdown block quotes containing headers dropping quote

2 participants