Skip to content

Commit

Permalink
fix: render of list (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
YangFong authored Aug 27, 2024
1 parent 223d59b commit 57c59bf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/utils/wx-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(``))
Expand Down

0 comments on commit 57c59bf

Please sign in to comment.