docxtemplater icon indicating copy to clipboard operation
docxtemplater copied to clipboard

Page break propogates to all elements inside div

Open tylerlinquata opened this issue 2 years ago • 5 comments

Environment

  • Version of docxtemplater : 3.42.2
  • Used docxtemplater-modules : HTML v3.37.1

How to reproduce my problem :

Reproducible using the HTML demo page and the following JSON:

{ 
    "html": "
<div>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
    </p>
    <p style='break-before: page'>
        Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
    </p>
    <p>
        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
    </p>
    <p>
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </p>
    <p>
        Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
    </p>
</div>
"}

I would expect it to :

  • break the page before the second paragraph

Actual outcome:

  • page is broken before every paragraph

tylerlinquata avatar Dec 27 '23 18:12 tylerlinquata

Hello @tylerlinquata ,

I'm looking into this, I hope to get a fix out by Tuesday !

Best,

Edgar

edi9999 avatar Dec 29 '23 20:12 edi9999

I can confirm the bug.

edi9999 avatar Dec 29 '23 20:12 edi9999

Thank you @edi9999!

tylerlinquata avatar Dec 29 '23 21:12 tylerlinquata

@tylerlinquata, while the bug isn't resolved use the tag span instead the tag p in the paragraph with the style attribute. It works for me.

Pablo87996 avatar Jan 02 '24 14:01 Pablo87996

I've just released a new version, 3.42.1 of the HTML module which fixes the issue :

Use following command to update all docxtemplater related dependencies :

npm install docxtemplater && npx -y update-docxtemplater && npm install

edi9999 avatar Jan 02 '24 17:01 edi9999