diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-06-13 11:09:57 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-06-13 11:09:57 +0100 |
| commit | 700e395a3d2a0c9f6526fe7c69a92bd347fa1b88 (patch) | |
| tree | cf8ca7d2ffb52f4f1c6443a87629cbb880243a23 /test | |
| parent | b67feb7858174f6ab954784b92b04c6474f29047 (diff) | |
Parse run highlights
Diffstat (limited to 'test')
| -rw-r--r-- | test/docx/body-reader.tests.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js index 5623f66..ddc060b 100644 --- a/test/docx/body-reader.tests.js +++ b/test/docx/body-reader.tests.js @@ -750,6 +750,21 @@ test("run with invalid w:sz has null font size", function() { assert.deepEqual(run.fontSize, null); }); +test("run has no highlight by default", function() { + var runXml = runWithProperties([]); + + var run = readXmlElementValue(runXml); + assert.deepEqual(run.highlight, null); +}); + +test("run has highlight read from properties", function() { + var fontXml = new XmlElement("w:highlight", {"w:val": "yellow"}); + var runXml = runWithProperties([fontXml]); + + var run = readXmlElementValue(runXml); + assert.deepEqual(run.highlight, "yellow"); +}); + test("run properties not included as child of run", function() { var runStyleXml = new XmlElement("w:rStyle"); var runPropertiesXml = new XmlElement("w:rPr", {}, [runStyleXml]); |
