Skip to content

Commit

Permalink
Merge pull request #2433 from hannesdorn/hotfix/AbstractPart-hyperlink
Browse files Browse the repository at this point in the history
Hotfix: In headings hyperlinks are ignored. Added w:hyperlink to xpath filter
  • Loading branch information
Progi1984 authored Aug 12, 2023
2 parents 409172c + f5f1ea3 commit 85d200a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpWord/Reader/Word2007/AbstractPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ protected function readParagraph(XMLReader $xmlReader, DOMElement $domNode, $par
} elseif ($headingDepth !== null) {
// Heading or Title
$textContent = null;
$nodes = $xmlReader->getElements('w:r', $domNode);
$nodes = $xmlReader->getElements('w:r|w:hyperlink', $domNode);
if ($nodes->length === 1) {
$textContent = htmlspecialchars($xmlReader->getValue('w:t', $nodes->item(0)), ENT_QUOTES, 'UTF-8');
} else {
Expand Down

0 comments on commit 85d200a

Please sign in to comment.