From 786ed7e34f5d6fe8adf80f7f5bae7abc6a037740 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 10 May 2016 21:29:20 +0100 Subject: Avoid merging in non-conforming cells --- tests/docx/body-reader.tests.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/docx/body-reader.tests.js b/tests/docx/body-reader.tests.js index 51d46fe..10554ed 100644 --- a/tests/docx/body-reader.tests.js +++ b/tests/docx/body-reader.tests.js @@ -328,6 +328,18 @@ describe("readXmlElement: ", function() { ])); }); + test("no merging if merged cells do not line up", function() { + var tableXml = new XmlElement("w:tbl", {}, [ + row(emptyCell(gridSpan("2"), vMerge("restart"))), + row(emptyCell(), emptyCell(vMerge("continue"))) + ]); + var result = readXmlElement(tableXml); + assert.deepEqual(result.value, new documents.Table([ + docRow([docEmptyCell({colSpan: 2})]), + docRow([docEmptyCell(), docEmptyCell()]), + ])); + }); + test("warning if non-row in table", function() { var tableXml = new XmlElement("w:tbl", {}, [ new XmlElement("w:p") -- cgit v1.2.3