Closed
Description
Hi,
Great application - thanks.
There is a problem when you have <
in string:
$html='<p>something < something </p>;
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $html);
It'll break the xml structure for docs. Possible solution is to change addHTML method:
// Load DOM
$dom = new \DOMDocument();
$dom->preserveWhiteSpace = true;
$dom->loadXML($html,LIBXML_NOCDATA);
With this replacement user can send <![CDATA[_lt_]]>
instead of <
like this:
$html='<p>something <![CDATA[_lt_]]> something </p>;
\PhpOffice\PhpWord\Shared\Html::addHtml($section, $html);
and it'll work ok.
Maybe there is some better solution but this will work for now.
Thanks