Hello,
We have run the following code with phpdocx 6 and phpdocx 8.2 (and also phpdocx 9, 10 and 11):
$docx = new CreateDocx();
$text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.';
$paragraphOptions = array(
'bold' => true,
'font' => 'Arial',
);
$docx->addText($text, $paragraphOptions);
$docx->addText($text, $paragraphOptions);
$content = new WordFragment($docx, 'document');
$content->addText(' New text.', array('fontSize' => 20, 'color' => '#0000ff'));
$referenceNode = array(
'type' => 'paragraph',
'occurrence' => 1,
'contains' => 'Lorem',
);
$docx->insertWordFragment($content, $referenceNode, 'inlineAfter');
$docx->createDocx('example_insertWordFragment_1');
$docx = new CreateDocxFromTemplate('example_insertWordFragment_1.docx');
$content = new WordFragment($docx, 'document');
$content->addText('Question 1) ', array('fontSize' => 12, 'bold' => true));
$referenceNode = array(
'type' => 'paragraph',
'occurrence' => 1,
);
$docx->insertWordFragment($content, $referenceNode, 'inlineBefore', false);
$docx->createDocx('ResultDoc.docx' );
that uses your DOCXPath code (although with other template because you haven't sent the template you are using), and the output is correct in all cases: Question 1) is added at the beginning of the first paragraph and there's no soft line break added.
Please run the previous code standalone. If you send to contact[at]phpdocx.com the template you are using we'll test it too.
Regards.