mirror of
https://github.com/doocs/md.git
synced 2025-01-22 20:04:39 +08:00
fix: correct ordered list start number rendering (#457)
This commit is contained in:
parent
c52593ba50
commit
1e887fe87e
@ -193,11 +193,11 @@ export function initRenderer(opts: IOpts) {
|
|||||||
return styledContent(`listitem`, `${prefix}${content}`, `li`)
|
return styledContent(`listitem`, `${prefix}${content}`, `li`)
|
||||||
},
|
},
|
||||||
|
|
||||||
list({ ordered, items }: Tokens.List): string {
|
list({ ordered, items, start = 1 }: Tokens.List): string {
|
||||||
const listItems = []
|
const listItems = []
|
||||||
for (let i = 0; i < items.length; i++) {
|
for (let i = 0; i < items.length; i++) {
|
||||||
isOrdered = ordered
|
isOrdered = ordered
|
||||||
listIndex = i
|
listIndex = Number(start) + i - 1
|
||||||
const item = items[i]
|
const item = items[i]
|
||||||
listItems.push(this.listitem(item))
|
listItems.push(this.listitem(item))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user