Skip to content

Commit ef95611

Browse files
committed
Fix multiple paragraphs being created
1 parent e7c551a commit ef95611

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/PhpWord/Reader/Word2007/AbstractPart.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,11 @@ protected function readParagraph(XMLReader $xmlReader, \DOMElement $domNode, $pa
167167
$parent->addTextBreak(null, $paragraphStyle);
168168
} else {
169169
$nodes = $xmlReader->getElements('*', $domNode);
170+
if ($runLinkCount > 1) {
171+
$parent = $parent->addTextRun($paragraphStyle);
172+
}
170173
foreach ($nodes as $node) {
171-
$this->readRun(
172-
$xmlReader,
173-
$node,
174-
($runLinkCount > 1) ? $parent->addTextRun($paragraphStyle) : $parent,
175-
$docPart,
176-
$paragraphStyle
177-
);
174+
$this->readRun($xmlReader, $node, $parent, $docPart, $paragraphStyle);
178175
}
179176
}
180177
}

0 commit comments

Comments
 (0)