fix: render of list (#360)

This commit is contained in:
YangFong 2024-08-28 07:46:14 +08:00 committed by GitHub
parent 223d59b5a2
commit 57c59bff33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -168,7 +168,14 @@ class WxRenderer extends Renderer {
for (let i = 0; i < items.length; i++) {
const { tokens } = items[i]
const prefix = ordered ? `${i + 1}. ` : ``
listItems.push(this.listitem(tokens, prefix))
for (const token of tokens) {
if (token.type === `list`) {
listItems.push(this.list(token))
}
else {
listItems.push(this.listitem([token], prefix))
}
}
}
const label = ordered ? `ol` : `ul`
return this.styledContent(label, listItems.join(``))