Skip to content

[lexical-markdown] Bug Fix: Add undo history entry for markdown shortcut transforms#8365

Merged
etrepum merged 3 commits intofacebook:mainfrom
kimseongyu:add-history-about-markdown-shortcuts-transform
Apr 18, 2026
Merged

[lexical-markdown] Bug Fix: Add undo history entry for markdown shortcut transforms#8365
etrepum merged 3 commits intofacebook:mainfrom
kimseongyu:add-history-about-markdown-shortcuts-transform

Conversation

@kimseongyu
Copy link
Copy Markdown
Contributor

Description

Current Behavior

Markdown shortcuts automatically convert markdown-like input into formatted content (for example, bold, italic, and heading). However, shortcut transforms are not recorded as separate undo history entries. The transform is merged with the triggering text input, so undo also removes the user input instead of only reverting the transform.

Changes in This PR

  • When a transform succeeds, add HISTORY_PUSH_TAG to create a separate undo history entry for the transform.
  • This allows users to undo the markdown formatting transform without undoing the triggering text input.

Closes #8256

Test plan

Before

before.mov

After

after.mov

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

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

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Apr 18, 2026 5:47am
lexical-playground Ready Ready Preview, Comment Apr 18, 2026 5:47am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 17, 2026
@etrepum etrepum added this pull request to the merge queue Apr 18, 2026
Merged via the queue into facebook:main with commit b3a1aa1 Apr 18, 2026
41 checks passed
@kimseongyu kimseongyu deleted the add-history-about-markdown-shortcuts-transform branch April 18, 2026 15:32
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.

Feature: Markdown shortcuts plugin should create an undo-history entry for its transform

2 participants