Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
54b9fa6
[lexical-markdown] Bug Fix: Keep closing ** or * before a link after …
fixfon Oct 21, 2026
87d4e00
Merge branch 'main' into fix/9403-markdown-export
etrepum Oct 29, 2026
012f181
[lexical-markdown] Bug Fix: Don't reopen a tag after a formatted spac…
claude Oct 29, 2026
eb0cbb3
[lexical-markdown] Bug Fix: Close a tag before a run of formatted spaces
claude Oct 29, 2026
ac084a8
[lexical-markdown] Chore: Cover misplaced closing tags in the changeset
claude Oct 29, 2026
d213512
[lexical-markdown] Bug Fix: Close tags at the end of an exported sele…
claude Oct 29, 2026
e68d97f
[lexical-markdown] Refactor: One rule for which text can hold a tag
claude Oct 29, 2026
ccd3128
[lexical-markdown] Bug Fix: Close a tag before a formatted line break
claude Oct 29, 2026
c0c6640
[lexical-markdown] Chore: Describe every behavior change in the chang…
claude Oct 29, 2026
a56e307
[lexical-markdown] Bug Fix: Close a tag before formatted text on the …
claude Oct 29, 2026
0008de7
[lexical-markdown] Chore: Fix stale comments in $exportTextFormat, re…
claude Oct 29, 2026
a13106f
[lexical-markdown] Bug Fix: Keep a tag open across soft-wrapped text …
claude Oct 29, 2026
9a90f35
[lexical-markdown] Bug Fix: Don't put tags around inline code that ho…
claude Oct 29, 2026
f560bce
[lexical-markdown] Chore: Test inline code that holds only a space
claude Oct 29, 2026
18eed93
[lexical-markdown] Refactor: Require every argument of $exportTextFormat
claude Oct 29, 2026
1ef27af
[lexical-markdown] Refactor: Share one return for inline code and tex…
claude Oct 29, 2026
b4b5aa2
[lexical-markdown] Chore: Fold the new whitespace export tests into t…
claude Oct 29, 2026
e170155
[lexical-markdown] Chore: Update the keep-open comment for the look-a…
claude Oct 29, 2026
8faba12
Merge branch 'main' into fix/9403-markdown-export
etrepum Oct 29, 2026
84b6e3f
[lexical-markdown] Bug Fix: Walk each run of formatted spaces once in…
claude Oct 29, 2026
820f131
[lexical][lexical-markdown] Bug Fix: Look up isSelected in a cached k…
claude Oct 29, 2026
1987ac9
[lexical][lexical-markdown] Bug Fix: Keep Markdown selection export l…
claude Oct 29, 2026
11df62a
[lexical][lexical-markdown] Bug Fix: Remove the remaining quadratic p…
claude Oct 29, 2026
105a27b
[lexical-markdown] Bug Fix: Remember negative look-ahead answers too
claude Oct 29, 2026
7a8e26c
[lexical-markdown] Refactor: Slice only text-point nodes without a si…
claude Oct 29, 2026
5f47c76
[lexical-markdown] Refactor: Remember look-ahead answers per node, in…
claude Oct 29, 2026
8ea5b97
[lexical-markdown] Refactor: Stop the look-ahead at a whitespace node…
claude Oct 29, 2026
4ef14ef
[lexical-selection][lexical-markdown] Refactor: Return early from $sl…
claude Oct 29, 2026
2e41cdc
[lexical-markdown] Chore: Declare OpenTag as an interface
claude Oct 29, 2026
b2a3fe5
Merge branch 'main' into fix/9403-markdown-export
etrepum Oct 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/markdown-formatted-whitespace-export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'lexical': patch
'@lexical/markdown': patch
'@lexical/selection': patch
---

[fix] Markdown export keeps format markers balanced around a space whose formats differ from the text beside it

Closing markers such as `**`, `*` or `~~` were dropped, repeated or placed after the space, so `**_a_ [b](u)**` exported as `***a* [**b**](u)`. `$convertSelectionToMarkdownString` also closes every marker when the selection ends inside formatted text. Empty inline code, such as inline code a selection only touches, is left out. Export stays linear in the length of a run of formatted spaces, and `$convertSelectionToMarkdownString` no longer works out the selection's nodes or range again for every node it exports. `LexicalNode.isSelected`, asked repeatedly of a selection that caches its nodes, looks the node up in a cached set of their keys instead of scanning them each time. `$sliceSelectedTextNodeContent` returns a node that no text point is in without working out the selection.

Verify: Markdown export, including of selections, of text where a space carries different formatting than the words around it.
Loading
Loading