Skip to content

Commit a68634c

Browse files
committed
Properly fixing #257 and helps out on #324
1 parent 995dc68 commit a68634c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/PhpWord/Shared/Html.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ private static function parseChildNodes($node, $element, $styles, $data)
177177
$cNodes = $node->childNodes;
178178
if (count($cNodes) > 0) {
179179
foreach ($cNodes as $cNode) {
180-
if ($element instanceof AbstractContainer) {
181-
self::parseNode($cNode, $element, $styles, $data);
182-
}
180+
self::parseNode($cNode, $element, $styles, $data);
183181
}
184182
}
185183
}
@@ -232,11 +230,9 @@ private static function parseText($node, $element, &$styles)
232230
{
233231
$styles['font'] = self::parseInlineStyle($node, $styles['font']);
234232

235-
// Commented as source of bug #257. `method_exists` doesn't seems to work properly in this case.
236-
// @todo Find better error checking for this one
237-
// if (method_exists($element, 'addText')) {
233+
if( is_callable(array($element, 'addText')) ) {
238234
$element->addText($node->nodeValue, $styles['font'], $styles['paragraph']);
239-
// }
235+
}
240236

241237
return null;
242238
}

0 commit comments

Comments
 (0)