Skip to content
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

Numbering restart doesn't work for mutual list. #1098

Open
yueqing-wolai opened this issue Aug 17, 2021 · 4 comments
Open

Numbering restart doesn't work for mutual list. #1098

yueqing-wolai opened this issue Aug 17, 2021 · 4 comments

Comments

@yueqing-wolai
Copy link

yueqing-wolai commented Aug 17, 2021

What I expected:
image

Real output:
image

Code:

    doc = new Document({
      sections: [{
        children: [
          new Paragraph({
            text: '1',
            numbering: {
              reference: 'my-crazy-reference',
              level: 0,
              instance: 1,
            },
            contextualSpacing: true,
          }),
          new Paragraph({
            text: '11',
            numbering: {
              reference: 'my-crazy-reference',
              level: 1,
              instance: 2
            },
            contextualSpacing: true,
          }),
          new Paragraph({
            text: '2',
            numbering: {
              reference: 'my-crazy-reference',
              level: 0,
              instance: 1,
            },
            contextualSpacing: true,
          }),
          new Paragraph({
            text: '21',
            numbering: {
              reference: 'my-crazy-reference',
              level: 1,
              instance: 4,
            },
            contextualSpacing: true,
          }),
        ]
      }
      ],
      numbering: {
        config : [
          {
            levels: [
              {
                level: 0,
                format: LevelFormat.DECIMAL,
                text: '%1.',
                alignment: AlignmentType.START,
                style: {
                  paragraph: {
                    indent: { left: convertInchesToTwip(0.5), hanging: convertInchesToTwip(0.18) },
                  },
                },
              },
              {
                level: 1,
                format: LevelFormat.DECIMAL,
                text: '%1.',
                alignment: AlignmentType.START,
                style: {
                  paragraph: {
                    indent: { left: convertInchesToTwip(0.75), hanging: convertInchesToTwip(0.18) },
                  },
                },
              },
            ],
            reference: 'my-crazy-reference',
          }
        ]
      }
    }
    )

The inner list numbering restart doesn't work. However, when I changed the third paragraph's instance to 3 , the outer list and inner restart both works. I am wondering am I do something wrong or this is a bug?

@anti-the-social
Copy link
Contributor

In your case you don't have to play with instance number.
Check it here #1077

@dolanmiu
Copy link
Owner

Does that resolve your issue?

@yueqing-wolai
Copy link
Author

yueqing-wolai commented Sep 1, 2021

Does that resolve your issue?

No, this is just a small part of my code. I used lots of numbering list in my document. Based on my understanding, a new instance number will reset the list number, and list with same instance number will continue the last list number on the same level, but it does not behave the way as I think.

@yueqing-wolai
Copy link
Author

The list number still not be restarted with different instance number. The simple example is shown above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants