From b3565aabb51e5c2403181e57813fd15f82786654 Mon Sep 17 00:00:00 2001 From: Christian Wooldridge <85259389+cwooldridge1@users.noreply.github.com> Date: Thu, 26 Dec 2024 13:43:09 -0700 Subject: [PATCH 1/2] fix: ordered list numbering --- .../markdown/src/lib/remark-slate/remarkDefaultElementRules.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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' }), }); From 23775b07606e8af15accd3add626ffe97db8b476 Mon Sep 17 00:00:00 2001 From: Ziad Beyens Date: Fri, 27 Dec 2024 16:03:47 +0100 Subject: [PATCH 2/2] Create rotten-balloons-cover.md --- .changeset/rotten-balloons-cover.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/rotten-balloons-cover.md 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