Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8ded5e3
[lexical-markdown] Bug Fix: Fix nested mixed-type list structure duri…
achaljhawar Apr 5, 2026
17b6f1c
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar Apr 7, 2026
22a22b7
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar Apr 8, 2026
4be8cd1
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar Apr 9, 2026
f6e2ccc
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar Apr 15, 2026
fa4d628
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar Apr 17, 2026
1853a25
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar Apr 24, 2026
98503af
[lexical-markdown] Bug Fix: Create separate list nodes for mixed-type…
achaljhawar Apr 24, 2026
3ea3561
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar Apr 27, 2026
0fc963c
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar Apr 30, 2026
cbdd1a8
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
etrepum May 2, 2026
403185b
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar May 2, 2026
dd18b1a
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar May 3, 2026
27b7386
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar May 8, 2026
857fc76
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar May 9, 2026
62b65a0
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar May 15, 2026
aa2542b
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar May 23, 2026
755ecca
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar May 26, 2026
5dd947e
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar May 29, 2026
eb191ff
Merge branch 'main' into fix/nested-mixed-type-list-markdown-import
achaljhawar Jun 6, 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
9 changes: 8 additions & 1 deletion packages/lexical-markdown/src/MarkdownTransformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ const listReplace = (listType: ListType): ElementTransformer['replace'] => {
firstMatchChar === listMarkerState.parse(firstMatchChar)
? firstMatchChar
: undefined;
const indent = getIndent(match[1]);
if ($isListNode(nextNode) && nextNode.getListType() === listType) {
if (listMarker) {
$setState(nextNode, listMarkerState, listMarker);
Expand All @@ -303,6 +304,9 @@ const listReplace = (listType: ListType): ElementTransformer['replace'] => {
}
previousNode.append(listItem);
parentNode.remove();
} else if (indent > 0 && $isListNode(previousNode)) {
previousNode.append(listItem);
parentNode.remove();
} else {
const list = $createListNode(
listType,
Expand All @@ -318,9 +322,12 @@ const listReplace = (listType: ListType): ElementTransformer['replace'] => {
if (!isImport) {
listItem.select(0, 0);
}
const indent = getIndent(match[1]);
if (indent) {
listItem.setIndent(indent);
const parentList = listItem.getParent();
if ($isListNode(parentList) && parentList.getListType() !== listType) {
parentList.setListType(listType);
}
Comment thread
achaljhawar marked this conversation as resolved.
}
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,18 @@ describe('Markdown', () => {
html: '<ol start="25"><li value="25"><span style="white-space: pre-wrap;">Hello</span></li><li value="26"><span style="white-space: pre-wrap;">world</span></li></ol>',
md: '25. Hello\n26. world',
},
{
html: '<ul><li value="1"><span style="white-space: pre-wrap;">bullet1</span></li><li value="2"><ol><li value="1"><span style="white-space: pre-wrap;">ordered1</span></li><li value="2"><span style="white-space: pre-wrap;">ordered2</span></li></ol></li><li value="2"><span style="white-space: pre-wrap;">bullet2</span></li></ul>',
md: '- bullet1\n 1. ordered1\n 2. ordered2\n- bullet2',
},
{
html: '<ol><li value="1"><span style="white-space: pre-wrap;">ordered1</span></li><li value="2"><ul><li value="1"><span style="white-space: pre-wrap;">bullet1</span></li><li value="2"><span style="white-space: pre-wrap;">bullet2</span></li></ul></li><li value="2"><span style="white-space: pre-wrap;">ordered2</span></li></ol>',
md: '1. ordered1\n - bullet1\n - bullet2\n2. ordered2',
},
{
html: '<ul><li value="1"><span style="white-space: pre-wrap;">a</span></li><li value="2"><ol><li value="1"><span style="white-space: pre-wrap;">b</span></li><li value="2"><ul><li value="1"><span style="white-space: pre-wrap;">c</span></li><li value="2"><span style="white-space: pre-wrap;">d</span></li></ul></li><li value="2"><span style="white-space: pre-wrap;">e</span></li></ol></li><li value="2"><span style="white-space: pre-wrap;">f</span></li></ul>',
md: '- a\n 1. b\n - c\n - d\n 2. e\n- f',
},
{
html: '<p><i><em style="white-space: pre-wrap;">Hello</em></i><span style="white-space: pre-wrap;"> world</span></p>',
md: '*Hello* world',
Expand Down