Skip to content

read from word2007 type, complex paragraphs will break into several lines #1043

@donghaobo

Description

@donghaobo

reader/word2007/abstract::readParagraph
if ($runLinkCount > 1) should create only one textRun as parent, but it created so many
the following change may work well

@@ -167,11 +167,14 @@ abstract class AbstractPart
                 $parent->addTextBreak(null, $paragraphStyle);
             } else {
                 $nodes = $xmlReader->getElements('*', $domNode);
+                if($runLinkCount > 1){
+                                       $parent = $parent->addTextRun($paragraphStyle);
+                               }
                 foreach ($nodes as $node) {
                     $this->readRun(
                         $xmlReader,
                         $node,
-                        ($runLinkCount > 1) ? $parent->addTextRun($paragraphStyle) : $parent,
+                        $parent,
                         $docPart,
                         $paragraphStyle
                     );

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions