summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-03-20 19:05:26 +0000
committerMichael Williamson <mike@zwobble.org>2024-03-20 19:05:26 +0000
commit2f693566b23e24933492574aea5be2be1fd6706c (patch)
tree17eee94c7c099076d38a13bbbf40447f7780a12f /lib
parent59a6ddc8938915f17fb4df4d6ff27451af79c6ad (diff)
Prefer numbering properties to numbering from paragraph style
Diffstat (limited to 'lib')
-rw-r--r--lib/docx/body-reader.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js
index b9bdb57..7a00164 100644
--- a/lib/docx/body-reader.js
+++ b/lib/docx/body-reader.js
@@ -553,6 +553,12 @@ function BodyReader(options) {
function readNumberingProperties(styleId, element, numbering) {
+ var level = element.firstOrEmpty("w:ilvl").attributes["w:val"];
+ var numId = element.firstOrEmpty("w:numId").attributes["w:val"];
+ if (level !== undefined && numId !== undefined) {
+ return numbering.findLevel(numId, level);
+ }
+
if (styleId != null) {
var levelByStyleId = numbering.findLevelByParagraphStyleId(styleId);
if (levelByStyleId != null) {
@@ -560,13 +566,7 @@ function readNumberingProperties(styleId, element, numbering) {
}
}
- var level = element.firstOrEmpty("w:ilvl").attributes["w:val"];
- var numId = element.firstOrEmpty("w:numId").attributes["w:val"];
- if (level === undefined || numId === undefined) {
- return null;
- } else {
- return numbering.findLevel(numId, level);
- }
+ return null;
}
var supportedImageTypes = {