diff --git a/src/ReactRenderer.ts b/src/ReactRenderer.ts index 5f15fe7..cd22340 100644 --- a/src/ReactRenderer.ts +++ b/src/ReactRenderer.ts @@ -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[]) { diff --git a/tests/markdown.spec.ts b/tests/markdown.spec.ts index 2aeaa67..b7da56f 100644 --- a/tests/markdown.spec.ts +++ b/tests/markdown.spec.ts @@ -86,7 +86,7 @@ const cases = [ { title: 'render ordered lists', markdown: '1. option-1\n2. option-2', - html: '
  1. option-1
  2. option-2
', + html: '
  1. option-1
  2. option-2
', }, { title: 'render ordered lists with different start value',