diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-02-19 11:06:32 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-02-19 11:06:32 +0000 |
| commit | f89115c9817b4cd4da91c7e3e9882b0eac4ae40d (patch) | |
| tree | 407ef0c07a0d6d567a16f6cc682915b2ee251289 | |
| parent | 140a1f71532d0a34df2cff7cff688e97dca7c164 (diff) | |
Reset currentInstrText on "begin" fldChar
| -rw-r--r-- | lib/docx/body-reader.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js index 11aeec5..a19ecdb 100644 --- a/lib/docx/body-reader.js +++ b/lib/docx/body-reader.js @@ -159,7 +159,9 @@ function BodyReader(options) { "w:rPr": readRunProperties, "w:fldChar": function(element) { var type = element.attributes["w:fldCharType"]; - if (type === "end") { + if (type === "begin") { + currentInstrText = []; + } else if (type === "end") { complexFields.pop(); } else if (type === "separate") { var href = parseHyperlinkFieldCode(currentInstrText.join('')); @@ -168,7 +170,6 @@ function BodyReader(options) { } else { complexFields.push(null); } - currentInstrText = []; } return emptyResult(); }, |
