diff --git a/src/PhpWord/Shared/Html.php b/src/PhpWord/Shared/Html.php index 72a8e23838..dd3bbab2c8 100644 --- a/src/PhpWord/Shared/Html.php +++ b/src/PhpWord/Shared/Html.php @@ -345,15 +345,16 @@ private static function parseListItem($node, $element, &$styles, $data) $listItemRun = $element->addListItemRun($data['listdepth'], $styles['list'], $styles['paragraph']); - $fontStyle = $styles['font']; foreach ($cNodes as $cNode) { if ($cNode->nodeName == '#text') { - $listItemRun->addText($cNode->nodeValue, $fontStyle); + $listItemRun->addText($cNode->nodeValue, $styles['font']); } elseif($cNode->nodeName == 'em') { + $fontStyle = $styles['font']; $fontStyle['italic'] = true; $listItemRun->addText($cNode->nodeValue, $fontStyle); } elseif($cNode->nodeName == 'strong') { + $fontStyle = $styles['font']; $fontStyle['bold'] = true; $listItemRun->addText($cNode->nodeValue, $fontStyle); }