Hello,
You can add line breaks and styles when adding text content (the same approach can be used with WordFragments):
$text = "A text with styles and \nbreaks \nand more contents.";
$paragraphOptions = array(
'bold' => true,
'font' => 'Arial',
'parseLineBreaks' => true,
);
$docx->addText($text, $paragraphOptions);
The sample Contents/addText/sample_6.php included in the package illustrates a similar code using parseLineBreaks and parseTabs options.
The parseLineBreaks option is available in many methods: https://www.phpdocx.com/documentation/api-documentation
HTML can also be used to add content with styles and line breaks.
Regards.