You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
creates a list with each item prefixed with "1.", instead of "1.", "2." and "3." as expected.
I did not dig too deep, but in this function "i" seems to be always 0.
I also ran into this problem. I solved it by editing the module locally so that it passes i to the drawListItem function on this line. Then I used pnpm patch so I didn't have to downgrade.
This fix works for my (simple) use case but I haven't tested it much or using customized options, but I'm happy to submit a PR. Here's the diff for my patch:
@@ -3359,11 +3359,10 @@ var TextMixin = {
return `${text}.`;
}
};
- const drawListItem = function (listItem) {+ const drawListItem = function (listItem, i) {
wrapper = new LineWrapper(this, options);
wrapper.on('line', this._line);
level = 1;
- let i = 0;
wrapper.once('firstLine', () => {
let item, itemType, labelType, bodyType;
if (options.structParent) {
@@ -3420,7 +3419,7 @@ var TextMixin = {
wrapper.wrap(listItem, options);
};
for (let i = 0; i < items.length; i++) {
- drawListItem.call(this, items[i]);+ drawListItem.call(this, items[i], i);
}
return this;
},
Bug Report
Bullet number on version 0.15.0 not work
Description of the problem
Bullet number on version 0.15.0 not work. Then I returned to version 0.14.0. It works well
Code sample
doc.list([
"A",
"B"
], {listType: "numbered", indent: 20, bulletIndent:20, textIndent:20, align: "left"});
Your environment
The text was updated successfully, but these errors were encountered: