aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Price <studiochris@users.noreply.github.com>2014-08-18 22:26:49 -0400
committerMichael Williamson <mike@zwobble.org>2014-08-20 10:38:50 +0100
commit76adc351b75b2489f3ef009a7e39df3dabadb50d (patch)
treeb12e26a3e3aa3f19ce30f25bda731c414e01d9c2 /tests
parent1ff800d5148068531419b179c8b9257ba9bd2e55 (diff)
Remove potential Unicode BOM after reading XML file
Diffstat (limited to 'tests')
-rw-r--r--tests/mammoth.tests.js8
-rw-r--r--tests/test-data/bom.docxbin0 -> 2836 bytes
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js
index e0c1f6c..9be7006 100644
--- a/tests/mammoth.tests.js
+++ b/tests/mammoth.tests.js
@@ -32,6 +32,14 @@ describe('mammoth', function() {
});
});
+ test('should read docx xml files with unicode byte order mark', function() {
+ var docxPath = path.join(__dirname, "test-data/bom.docx");
+ return mammoth.convertToHtml({path: docxPath}).then(function (result) {
+ assert.equal(result.value, "<p>This XML has a byte order mark.</p>");
+ assert.deepEqual(result.messages, []);
+ });
+ });
+
test('style map can be expressed as string', function() {
var docxFile = createFakeDocxFile({
"word/document.xml": testData("simple/word/document.xml")
diff --git a/tests/test-data/bom.docx b/tests/test-data/bom.docx
new file mode 100644
index 0000000..3881238
--- /dev/null
+++ b/tests/test-data/bom.docx
Binary files differ