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