[ODS] Add support for whitespaces inside <text:span>

The `<text:p>` node can contain the string value directly or contain child elements. In this case, whitespaces contain in the child elements should be replaced by their XML equivalent:
 - space => `<text:s />`
 - tab => `<text:tab />`
 - line break => `<text:line-break />`

@see https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415200_253892949
This commit is contained in:
Adrien Loison committed 2019-10-27 20:14:51 +01:00
1 parent 9f4c094fa0
commit dbdf5f7f38
3 files changed
+80 -18

No files matched your search

+11
View File
@@ -277,6 +277,17 @@ class ReaderTest extends TestCase
$this->assertEquals([$expectedRow], $allRows);
}
/**
* @return void
*/
public function testReadShouldSupportWhitespaceAsXML()
{
$allRows = $this->getAllRowsForFile('sheet_with_whitespaces_as_xml.ods');
$expectedRow = ["Lorem ipsum\tdolor sit amet"];
$this->assertEquals([$expectedRow], $allRows);
}
/**
* @NOTE: The LIBXML_NOENT is used to ACTUALLY substitute entities (and should therefore not be used)
*