Repository navigation
Conversation
…exported HTML MentionNode.exportDOM built a bare <span data-lexical-mention> from this.__text, so the node's inline style (e.g. a font-size chosen from the toolbar dropdown) and its text formats were dropped from the generated HTML even though they were present in the editor state. Carry the inline style onto the exported span and wrap it in the same <b>/<i>/<s>/<u> elements TextNode.exportDOM uses. The mention element itself stays a <span> so the span[data-lexical-mention] import rule still matches it.
LeSingh1
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7,
potatowagon and
zurfyx
as code owners
August 8, 2026 00:54
|
@LeSingh1 is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MentionNode.exportDOM()created a bare<span data-lexical-mention>fromthis.__textand ignored the node's__styleand__format. Applying a font size from the toolbar dropdown to a selection containing a mention updates the editor state correctly (style: "font-size: 20px;"), but the mention is exported as an unstyled span — the symptom in #6453, visible in the playground's Tree View "Export DOM" panel. Text formats were dropped the same way.The export now carries the inline style onto the span and wraps it in the same
<b>/<i>/<s>/<u>elementsTextNode.exportDOMuses. The mention element itself stays a<span>so thespan[data-lexical-mention]import rule still matches it and mentions keep round-tripping.Adds
MentionHTML.test.ts: two tests for the reported symptom, plus two controls — the unchanged plain-mention export shape, and an export-import round trip confirming the format wrappers don't break mention recognition.One adjacent bug I found and deliberately left alone: the mention import rule in
MentionsExtension/index.tsxdoes not readctx.get(ImportTextFormat)/ImportTextStylethe way the core#textrule does, so a bold mention pasted back in loses its bold. That is independent of this change — before it, there was nothing exported to lose — and it belongs in its own PR.Fixes #6453