Adding support for <text:s> inside <text:span> (fixes #666)

This commit is contained in:
Daniele De Nobili 2019-07-10 14:15:24 +02:00
parent 6c4086cf97
commit 24f81cc219

View File

@ -96,6 +96,21 @@ class CellValueFormatter
$pNodes = $node->getElementsByTagName(self::XML_NODE_P);
foreach ($pNodes as $pNode) {
$pNodeValues[] = $this->extractTextFromNode($pNode);
}
$escapedCellValue = implode("\n", $pNodeValues);
$cellValue = $this->escaper->unescape($escapedCellValue);
return $cellValue;
}
/**
* @param \DOMNode $pNode
* @return string
*/
protected function extractTextFromNode($pNode)
{
$currentPValue = '';
foreach ($pNode->childNodes as $childNode) {
@ -106,17 +121,11 @@ class CellValueFormatter
$numSpaces = (!empty($spaceAttribute)) ? (int) $spaceAttribute : 1;
$currentPValue .= str_repeat(' ', $numSpaces);
} elseif ($childNode->nodeName === self::XML_NODE_A || $childNode->nodeName === self::XML_NODE_SPAN) {
$currentPValue .= $childNode->nodeValue;
$currentPValue .= $this->extractTextFromNode($childNode);
}
}
$pNodeValues[] = $currentPValue;
}
$escapedCellValue = implode("\n", $pNodeValues);
$cellValue = $this->escaper->unescape($escapedCellValue);
return $cellValue;
return $currentPValue;
}
/**