Adding support for <text:s> inside <text:span> (fixes #666)
This commit is contained in:
parent
6c4086cf97
commit
24f81cc219
@ -96,6 +96,21 @@ class CellValueFormatter
|
|||||||
$pNodes = $node->getElementsByTagName(self::XML_NODE_P);
|
$pNodes = $node->getElementsByTagName(self::XML_NODE_P);
|
||||||
|
|
||||||
foreach ($pNodes as $pNode) {
|
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 = '';
|
$currentPValue = '';
|
||||||
|
|
||||||
foreach ($pNode->childNodes as $childNode) {
|
foreach ($pNode->childNodes as $childNode) {
|
||||||
@ -106,17 +121,11 @@ class CellValueFormatter
|
|||||||
$numSpaces = (!empty($spaceAttribute)) ? (int) $spaceAttribute : 1;
|
$numSpaces = (!empty($spaceAttribute)) ? (int) $spaceAttribute : 1;
|
||||||
$currentPValue .= str_repeat(' ', $numSpaces);
|
$currentPValue .= str_repeat(' ', $numSpaces);
|
||||||
} elseif ($childNode->nodeName === self::XML_NODE_A || $childNode->nodeName === self::XML_NODE_SPAN) {
|
} elseif ($childNode->nodeName === self::XML_NODE_A || $childNode->nodeName === self::XML_NODE_SPAN) {
|
||||||
$currentPValue .= $childNode->nodeValue;
|
$currentPValue .= $this->extractTextFromNode($childNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pNodeValues[] = $currentPValue;
|
return $currentPValue;
|
||||||
}
|
|
||||||
|
|
||||||
$escapedCellValue = implode("\n", $pNodeValues);
|
|
||||||
$cellValue = $this->escaper->unescape($escapedCellValue);
|
|
||||||
|
|
||||||
return $cellValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user