diff options
| author | Michael Williamson <mike@zwobble.org> | 2025-08-03 07:47:58 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2025-08-03 07:47:58 +0100 |
| commit | 033466fcb57ba2f4c0f876ed8dec705de5c68333 (patch) | |
| tree | 60522f1c52d017eb9451d9be12eab357fceace45 /test | |
| parent | 67761754e4333fcb0ddccf06508a8631ce016c09 (diff) | |
Ignore style definitions using a style ID that has already been used
Diffstat (limited to 'test')
| -rw-r--r-- | test/docx/styles-reader.tests.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/docx/styles-reader.tests.js b/test/docx/styles-reader.tests.js index 0997d2c..b63bb6a 100644 --- a/test/docx/styles-reader.tests.js +++ b/test/docx/styles-reader.tests.js @@ -110,6 +110,16 @@ test('numbering style has numId read from paragraph properties', function() { assert.equal(styles.findNumberingStyleById("List1").numId, "42"); }); +test('when multiple style elements have same style ID then only first element is used', function() { + var styles = readStylesXml( + new XmlElement("w:styles", {}, [ + tableStyleElement("TableNormal", "Normal Table"), + tableStyleElement("TableNormal", "Table Normal") + ]) + ); + assert.equal(styles.findTableStyleById("TableNormal").name, "Normal Table"); +}); + function paragraphStyleElement(id, name) { return styleElement("paragraph", id, name); } |
