From 16f9304b57cd7553f42a01da0418c9d8f9954e76 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 19 Feb 2017 21:12:45 +0000 Subject: Clarify that complexFields is a stack --- lib/docx/body-reader.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') 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(); -- cgit v1.2.3