diff --git a/.changeset/rotten-balloons-cover.md b/.changeset/rotten-balloons-cover.md new file mode 100644 index 0000000000..26e7d688ad --- /dev/null +++ b/.changeset/rotten-balloons-cover.md @@ -0,0 +1,5 @@ +--- +"@udecode/plate-markdown": patch +--- + +fix: markdown parser ordered list numbering diff --git a/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts b/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts index 21eac86b12..96b87c0493 100644 --- a/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts +++ b/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts @@ -79,7 +79,7 @@ export const remarkDefaultElementRules: RemarkElementRules = { listItems: TElement[] = [], indent = 1 ) => { - _node.children?.forEach((listItem) => { + _node.children?.forEach((listItem, index) => { if (!listItem.children) { listItems.push({ children: remarkTransformElementChildren(listItem, options), @@ -98,6 +98,7 @@ export const remarkDefaultElementRules: RemarkElementRules = { ), indent, listStyleType, + listStart: index + 1, type: options.editor.getType({ key: 'p' }), });