-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bullet number on version 0.15.0 not work #1517
Comments
I do not know what @thuskin means with "not work", but I can confirm that there is a problem with that function.
creates a list with each item prefixed with "1.", instead of "1.", "2." and "3." as expected. |
I also ran into this problem. I solved it by editing the module locally so that it passes 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: