diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-02-19 21:12:45 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-02-19 21:12:45 +0000 |
| commit | 16f9304b57cd7553f42a01da0418c9d8f9954e76 (patch) | |
| tree | 54e4e977d43c92b2cc6f5c5b17356749683cd266 /lib | |
| parent | e627e1772c911eb90dd11755b7ac5665d4a015b3 (diff) | |
Clarify that complexFields is a stack
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/docx/body-reader.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js index 80715ca..6155304 100644 --- a/lib/docx/body-reader.js +++ b/lib/docx/body-reader.js @@ -20,7 +20,7 @@ function createBodyReader(options) { } function BodyReader(options) { - var complexFields = []; + var complexFieldStack = []; var currentInstrText = []; var relationships = options.relationships; var contentTypes = options.contentTypes; @@ -148,7 +148,7 @@ function BodyReader(options) { var properties = _.find(children, isRunProperties); children = children.filter(negate(isRunProperties)); - var scopedHyperlink = scopedComplexFieldOfType(complexFields, "hyperlink"); + var scopedHyperlink = scopedComplexFieldOfType(complexFieldStack, "hyperlink"); if (scopedHyperlink !== undefined) { children = [new documents.Hyperlink(children, {href: scopedHyperlink.href})]; } @@ -162,13 +162,13 @@ function BodyReader(options) { if (type === "begin") { currentInstrText = []; } else if (type === "end") { - complexFields.pop(); + complexFieldStack.pop(); } else if (type === "separate") { var href = parseHyperlinkFieldCode(currentInstrText.join('')); if (href !== null) { - complexFields.push({type: "hyperlink", href: href}); + complexFieldStack.push({type: "hyperlink", href: href}); } else { - complexFields.push({type: "unknown"}); + complexFieldStack.push({type: "unknown"}); } } return emptyResult(); |
