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

Lists - instance not working with level greater than 0 #2423

Open
agusbarrio opened this issue Nov 15, 2023 · 0 comments
Open

Lists - instance not working with level greater than 0 #2423

agusbarrio opened this issue Nov 15, 2023 · 0 comments

Comments

@agusbarrio
Copy link

When the level is greater than 0, the instance prop is ignored

Try with this example

  const doc = new Document({
      numbering: {
        config: [
          {
            reference: 'ref1',
            levels: [
              {
                level: 0,
                format: LevelFormat.DECIMAL,
                text: '%1'
              },
              {
                level: 1,
                format: LevelFormat.DECIMAL,
                text: '%1.%2'
              },
              {
                level: 2,
                format: LevelFormat.DECIMAL,
                text: '%1.%2.%3'
              }
            ]
          },
          {
            reference: 'ref2',
            levels: [
              {
                level: 0,
                format: LevelFormat.DECIMAL,
                text: '%1'
              },
              {
                level: 1,
                format: LevelFormat.DECIMAL,
                text: '%1.%2'
              },
              {
                level: 2,
                format: LevelFormat.DECIMAL,
                text: '%1.%2.%3'
              }
            ]
          }
        ]
      },
      sections: [
        {
          children: [
            new Paragraph({
              text: 'REF1 - inst:0 - lvl:1',
              numbering: {
                reference: 'ref1',
                instance: 0,
                level: 1
              }
            }),
            new Paragraph({
              text: 'REF1 - inst:0 - lvl:1',
              numbering: {
                reference: 'ref1',
                instance: 0,
                level: 1
              }
            }),
            new Paragraph({
              text: 'REF1 - inst:1 - lvl:1',
              numbering: {
                reference: 'ref1',
                instance: 1,
                level: 1
              }
            }),
            new Paragraph({
              text: 'REF1 - inst:1 - lvl:1',
              numbering: {
                reference: 'ref1',
                instance: 1,
                level: 1
              }
            }),
            new Paragraph({
              text: 'REF2 - inst:0 - lvl:1',
              numbering: {
                reference: 'ref2',
                instance: 0,
                level: 1
              }
            }),
            new Paragraph({
              text: 'REF2 - inst:0 - lvl:1',
              numbering: {
                reference: 'ref2',
                instance: 0,
                level: 1
              }
            })
          ]
        }
      ]
    });

Current resulting document:
image

Expected resulting document:
image

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

1 participant