PhpWord and n in line together with HTML code

Using PhpWord in my PHP project gives me issues.
I do have a variable containing CR/LF (n) and HTML code.
Something like:

$str='<div style="font-style: italic; text-align:center">Line1
line2
line3</div>';

The text is comming out of a MySql text field containing n as line separator.

When processing this text with PhpOfficePhpWordSharedHtml::addHtml, I am losing the CR/LF. All text is concatenated. When replacing n with html CRLF
$str=str_replace("n","<br>",$str); and then use addHtml, it gives me run-time errors:

Warning: DOMDocument::loadXML(): Opening and ending tag mismatch: br line 1 and div in Entity, line: 1 in /customers/7/4/3/ofiser.be/httpd.www/vieringen/vendor/phpoffice/phpword/src/PhpWord/Shared/Html.php on line 94

How can I process this text? Any help is appreciated.