Hello,
We have checked it and it's working fine after applying the previous lines to HTML2WordML.inc. But due to how MS Word works, you need to add the page-break-after style to accomplish what you need.
This is a simple sample that illustrates how to do it (you can use inline styles or a external CSS):
$html = '
<p style="page-break-inside: avoid;">
<p style="page-break-inside: avoid; page-break-after: avoid;">Some text</p>
<ol>
<li style="page-break-inside: avoid; page-break-after: avoid;">Item 1</li>
<li style="page-break-inside: avoid; page-break-after: avoid;">Item 2</li>
</ol>
</p>
';
$docx->embedHTML($html);
If you open the DOCX with MS Word, you can see that the paragraph and lists have the keep with next option enabled and act as a 'block' for the content page.
On the snippets section (https://www.phpdocx.com/documentation/snippets/) you can find some samples about this same question.
Regards.