diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-08-09 14:52:51 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-08-09 14:52:51 +0100 |
| commit | c69ea62ed5e7d5ef046d7d00772d9bb7b100daf6 (patch) | |
| tree | 29b14d35a77db9b675d49893c43c16e8773bf049 /test | |
| parent | fbf5e226ec9194ab67081cb9ecdd5f839cd87c3a (diff) | |
Ignore numbering levels that use numStyleLink to refer to themselves
Diffstat (limited to 'test')
| -rw-r--r-- | test/docx/numbering-xml.tests.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/docx/numbering-xml.tests.js b/test/docx/numbering-xml.tests.js index 004e9ab..e98cdf7 100644 --- a/test/docx/numbering-xml.tests.js +++ b/test/docx/numbering-xml.tests.js @@ -152,6 +152,22 @@ test('when w:abstractNum has w:numStyleLink then style is used to find w:num', f }); +test('when w:abstractNum has self-recursive w:numStyleLink then level is not found', function() { + var numbering = readNumberingXml( + new XmlElement("w:numbering", {}, [ + new XmlElement("w:abstractNum", {"w:abstractNumId": "100"}, [ + new XmlElement("w:numStyleLink", {"w:val": "List1"}) + ]), + new XmlElement("w:num", {"w:numId": "200"}, [ + new XmlElement("w:abstractNumId", {"w:val": "100"}) + ]) + ]), + {styles: new stylesReader.Styles({}, {}, {}, {"List1": {numId: "200"}})} + ); + duck.assertThat(numbering.findLevel("200", "0"), duck.equalTo(null)); +}); + + // See: 17.9.23 pStyle (Paragraph Style's Associated Numbering Level) in ECMA-376, 4th Edition test('numbering level can be found by paragraph style ID', function() { var numbering = readNumberingXml( |
