Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
etrepum
approved these changes
Mar 29, 2025
Collaborator
etrepum
left a comment
There was a problem hiding this comment.
Looks like it works well, nice job!
Merged
fantactuka
pushed a commit
that referenced
this pull request
Aug 11, 2025
…tring has leading and trailing whitespaces (#7400)
reinseth
added a commit
to reinseth/lexical
that referenced
this pull request
Nov 8, 2025
…en the string has leading and trailing whitespaces (facebook#7400)" This reverts commit 4d459e3. # Conflicts: # packages/lexical-markdown/src/__tests__/unit/LexicalMarkdown.test.ts # packages/lexical-markdown/src/importTextTransformers.ts
reinseth
added a commit
to reinseth/lexical
that referenced
this pull request
Feb 23, 2026
…en the string has leading and trailing whitespaces (facebook#7400)" This reverts commit 4d459e3.
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.
Description
Currently,
exportTextFormatinMardownExportstrim the input first to handle the case looking like** foo **An edge case here is if the string consists only of whitespaces, the trimmed string will be empty.
Based on the discussion here, one possible solution is replacing the whitespace with its corresponding code points, which is also compatible with CommonMark.
Also, modify some test cases that have leading and trailing whitespaces.
Closes #6526
Test plan
Add a new unit test
Before
Screen.Recording.2025-03-26.at.12.03.16.mov
After
Screen.Recording.2025-03-27.at.13.02.50.mov
Test other whitespaces
Screen.Recording.2025-03-27.at.22.43.29.mov