Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lexical-markdown] Bug Fix: support link and inline code text formats #7004

Merged
merged 25 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
01ecf0e
fix(markdown): incorrect markdown import for links containing text fo…
AlessioGr Dec 30, 2024
3628b82
simpler test examples
AlessioGr Dec 30, 2024
eb0ca84
fix: markdown export for link nodes with text formats
AlessioGr Dec 30, 2024
957bc66
new text format & text match importing logic. This ensures that outer…
AlessioGr Dec 30, 2024
054c865
add tests
AlessioGr Dec 30, 2024
320a569
fix export
AlessioGr Dec 30, 2024
5c4e11b
remove console.log
AlessioGr Dec 30, 2024
81f0a13
Merge branch 'main' into fork/fix-md-link-text-formats
AlessioGr Dec 30, 2024
14cda52
fix lint errors
AlessioGr Dec 30, 2024
b66b8cc
fix build
AlessioGr Dec 30, 2024
4dbded1
fix build
AlessioGr Dec 30, 2024
db80558
fix: node tags opened before the link node were incorrectly closed wi…
AlessioGr Dec 30, 2024
fb1a91c
add comment explaining logic
AlessioGr Dec 30, 2024
d4dbf73
fix: consecutive text match was not processed
AlessioGr Dec 30, 2024
8f051ad
fix: formatted inline code block are not formatted in the correct order
AlessioGr Jan 7, 2025
8afcb0d
Merge branch 'main' into fork/fix-md-link-text-formats
AlessioGr Jan 7, 2025
7f04ef3
more reliable fix
AlessioGr Jan 7, 2025
113860c
Merge branch 'main' into fork/fix-md-link-text-formats
etrepum Jan 20, 2025
4fd26bb
perf: less array.include calls
AlessioGr Jan 21, 2025
7987e04
perf: shared canContainTransformableMarkdown function, avoid editor.u…
AlessioGr Jan 21, 2025
a820427
Merge branch 'main' into fork/fix-md-link-text-formats
AlessioGr Jan 21, 2025
a0898cd
sanitize link title
AlessioGr Jan 21, 2025
51bf22b
undo change
AlessioGr Jan 21, 2025
ef76143
Merge branch 'main' into fork/fix-md-link-text-formats
AlessioGr Jan 28, 2025
0de5cc1
fix tests
AlessioGr Jan 28, 2025
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
Prev Previous commit
Next Next commit
more reliable fix
AlessioGr committed Jan 7, 2025
commit 7f04ef399b91aff1bd3e438e0e5778c89976a787
4 changes: 2 additions & 2 deletions packages/lexical-markdown/src/MarkdownExport.ts
Original file line number Diff line number Diff line change
@@ -44,9 +44,9 @@ export function createMarkdownExport(
// <strong><code>code</code></strong> will be exported as `**Bold Code**`, as the code format will be applied first, and the bold format
// will be applied second and thus skipped entirely, as the code format will prevent any further formatting.
.sort((a, b) => {
if (a.format[0] === 'code' && b.format[0] !== 'code') {
if (a.format.includes('code') && !b.format.includes('code')) {
return 1;
} else if (a.format[0] !== 'code' && b.format[0] === 'code') {
} else if (!a.format.includes('code') && b.format.includes('code')) {
return -1;
} else {
return 0;