-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
Description
Describe the Bug
LI tag with inline style ""text-align:justify" does not justify text inside LI element.
Steps to Reproduce
<ol>
<li style="text-align:justify;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam..</li>
</ol>
Possible solution
/PhpWord/Shared/Html.php
protected static function parseListItem($node, $element, &$styles, $data)
{
$cNodes = $node->childNodes;
if (!empty($cNodes)) {
/*FIX issue with incorrect style parsing of LI element*/
$styles['paragraph'] = self::recursiveParseStylesInHierarchy($node, $styles['paragraph']);
/**/
$listRun = $element->addListItemRun($data['listdepth'], $styles['list'], $styles['paragraph']);
foreach ($cNodes as $cNode) {
self::parseNode($cNode, $listRun, $styles, $data);
}
}
}
Context
- PHP Version: 7.3.1
- PHPWord Version: 0.18.3
akurczewska and Kell