diff --git a/.gitignore b/.gitignore index dd858cea..da661ee3 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ phpword.ini /.project /nbproject /.php_cs.cache +docker-compose.yml +/phpdocker +/public diff --git a/src/PhpWord/Reader/Word2007/AbstractPart.php b/src/PhpWord/Reader/Word2007/AbstractPart.php index 06dfe37b..17dbceb4 100644 --- a/src/PhpWord/Reader/Word2007/AbstractPart.php +++ b/src/PhpWord/Reader/Word2007/AbstractPart.php @@ -292,6 +292,19 @@ abstract class AbstractPart $parent->addTextBreak(); } elseif ($node->nodeName == 'w:tab') { $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') { // TextRun $textContent = htmlspecialchars($xmlReader->getValue('.', $node), ENT_QUOTES, 'UTF-8');