Properly fixing #257 and helps out on #324

This commit is contained in:
Gareth Ellis 2016-02-04 13:40:16 +00:00
parent 995dc68706
commit a68634c3f1

View File

@ -177,9 +177,7 @@ class Html
$cNodes = $node->childNodes; $cNodes = $node->childNodes;
if (count($cNodes) > 0) { if (count($cNodes) > 0) {
foreach ($cNodes as $cNode) { foreach ($cNodes as $cNode) {
if ($element instanceof AbstractContainer) { self::parseNode($cNode, $element, $styles, $data);
self::parseNode($cNode, $element, $styles, $data);
}
} }
} }
} }
@ -232,11 +230,9 @@ class Html
{ {
$styles['font'] = self::parseInlineStyle($node, $styles['font']); $styles['font'] = self::parseInlineStyle($node, $styles['font']);
// Commented as source of bug #257. `method_exists` doesn't seems to work properly in this case. if( is_callable(array($element, 'addText')) ) {
// @todo Find better error checking for this one
// if (method_exists($element, 'addText')) {
$element->addText($node->nodeValue, $styles['font'], $styles['paragraph']); $element->addText($node->nodeValue, $styles['font'], $styles['paragraph']);
// } }
return null; return null;
} }