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

Using a unique numbering instance number does not reset the ordered list numbering if the level is greater than 0 #2877

Open
Markiz9999 opened this issue Dec 3, 2024 · 0 comments

Comments

@Markiz9999
Copy link

The list numbering is not reset if the numbering level is greater than 0 and a unique instance number is used.

This is only reproducible when there are no other lists with different levels between several lists of the same level.

Example of issue reproduction: https://codesandbox.io/p/sandbox/wr4k8c

After an investigation, I would say that the problem is in the structure of the DOCX generated by this library. This library only overrides the first level of the concrete numbering when creating (here https://github.com/dolanmiu/docx/blob/master/src/file/numbering/numbering.ts#L222).
So we get this as a result even when the list level is greater than 0:

<w:num w:numId="5">
    <w:abstractNumId w:val="2" />
    <w:lvlOverride w:ilvl="0">
        <w:startOverride w:val="1" />
    </w:lvlOverride>
</w:num>

Actual result:

1. List item 1 Level 0
2. List item 2 Level 0
3. List item 3 Level 0
List separator paragraph
1. List item 1 Level 0
2. List item 2 Level 0
3. List item 3 Level 0
List separator paragraph
  1. List item 1 Level 1
  2. List item 2 Level 1
  3. List item 3 Level 1
List separator paragraph
  4. List item 1 Level 1
  5. List item 2 Level 1
  6. List item 3 Level 1

Expected result:

1. List item 1 Level 0
2. List item 2 Level 0
3. List item 3 Level 0
List separator paragraph
1. List item 1 Level 0
2. List item 2 Level 0
3. List item 3 Level 0
List separator paragraph
  1. List item 1 Level 1
  2. List item 2 Level 1
  3. List item 3 Level 1
List separator paragraph
  1. List item 1 Level 1
  2. List item 2 Level 1
  3. List item 3 Level 1
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