Skip to content

Commit b1661af

Browse files
authored
Still add text if link missing
If link target doesn't exist, still add the text anyway.
1 parent 0db21ae commit b1661af

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/PhpWord/Reader/Word2007/AbstractPart.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ protected function readRunChild(XMLReader $xmlReader, \DOMElement $node, Abstrac
297297
$target = $this->getMediaTarget($docPart, $rId);
298298
if (!is_null($target)) {
299299
$parent->addLink($target, $textContent, $fontStyle, $paragraphStyle);
300+
} else {
301+
$parent->addText($textContent, $fontStyle, $paragraphStyle);
300302
}
301303
} else {
302304
/** @var AbstractElement $element */

0 commit comments

Comments
 (0)