Skip to content

Commit

Permalink
Restore original behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-Dang committed Dec 4, 2024
1 parent 113b38e commit c957565
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ReactRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class ReactRenderer {
}

list(children: ReactNode, ordered: boolean, start: number | undefined) {
return this.#h(ordered ? 'ol' : 'ul', children, ordered ? { start } : {});
return this.#h(ordered ? 'ol' : 'ul', children, ordered && start !== 1 ? { start } : {});
}

listItem(children: ReactNode[]) {
Expand Down
2 changes: 1 addition & 1 deletion tests/markdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const cases = [
{
title: 'render ordered lists',
markdown: '1. option-1\n2. option-2',
html: '<ol start="1"><li>option-1</li><li>option-2</li></ol>',
html: '<ol><li>option-1</li><li>option-2</li></ol>',
},
{
title: 'render ordered lists with different start value',
Expand Down

0 comments on commit c957565

Please sign in to comment.