Add support for mc:AlternateContent
This commit is contained in:
parent
ec1b3d35ee
commit
3a7dd774a2
|
|
@ -21,3 +21,6 @@ phpword.ini
|
||||||
/.project
|
/.project
|
||||||
/nbproject
|
/nbproject
|
||||||
/.php_cs.cache
|
/.php_cs.cache
|
||||||
|
docker-compose.yml
|
||||||
|
/phpdocker
|
||||||
|
/public
|
||||||
|
|
|
||||||
|
|
@ -292,6 +292,19 @@ abstract class AbstractPart
|
||||||
$parent->addTextBreak();
|
$parent->addTextBreak();
|
||||||
} elseif ($node->nodeName == 'w:tab') {
|
} elseif ($node->nodeName == 'w:tab') {
|
||||||
$parent->addText("\t");
|
$parent->addText("\t");
|
||||||
|
} elseif ($node->nodeName == 'mc:AlternateContent') {
|
||||||
|
$hasChildren = $node->childNodes->length > 0;
|
||||||
|
|
||||||
|
if ($hasChildren) {
|
||||||
|
$origin = $node->childNodes->item($node->childNodes->length - 1);
|
||||||
|
|
||||||
|
if ($origin->nodeValue) {
|
||||||
|
// TextRun
|
||||||
|
$textContent = htmlspecialchars($origin->nodeValue, ENT_QUOTES, 'UTF-8');
|
||||||
|
|
||||||
|
$parent->addText($textContent, $fontStyle, $paragraphStyle);
|
||||||
|
}
|
||||||
|
}
|
||||||
} elseif ($node->nodeName == 'w:t' || $node->nodeName == 'w:delText') {
|
} elseif ($node->nodeName == 'w:t' || $node->nodeName == 'w:delText') {
|
||||||
// TextRun
|
// TextRun
|
||||||
$textContent = htmlspecialchars($xmlReader->getValue('.', $node), ENT_QUOTES, 'UTF-8');
|
$textContent = htmlspecialchars($xmlReader->getValue('.', $node), ENT_QUOTES, 'UTF-8');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue