Another bug found:
When a tag has style="..." attribute, it is applied to all the following tags of the same type. For example, in the following:
<p> There shouldn't be a page break after me. </p>
<p> But there will be one... </p>
The style attribute in the first div tag affects all the following div tags.