aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/docx/office-xml-reader.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/docx/office-xml-reader.js b/lib/docx/office-xml-reader.js
index 861b11e..b4e21e5 100644
--- a/lib/docx/office-xml-reader.js
+++ b/lib/docx/office-xml-reader.js
@@ -22,11 +22,14 @@ function read(xmlString) {
function readXmlFromZipFile(docxFile, path) {
if (docxFile.exists(path)) {
return docxFile.read(path, "utf-8")
- .then(function (xmlString) {
- return xmlString.replace(/^\uFEFF/g, '');
- })
+ .then(stripUtf8Bom)
.then(read);
} else {
return promises.resolve(null);
}
}
+
+
+function stripUtf8Bom(xmlString) {
+ return xmlString.replace(/^\uFEFF/g, '');
+}