danfickle / openhtmltopdf

An HTML to PDF library for the JVM. Based on Flying Saucer and Apache PDF-BOX 2. With SVG image support. Now also with accessible PDF support (WCAG, Section 508, PDF/UA)!
https://danfickle.github.io/pdf-templates/index.html
Other
1.93k stars 359 forks source link

Display: table not working anymore after updating to v1.0.10 used in pseudo-element :after #844

Open Phq-art opened 2 years ago

Phq-art commented 2 years ago

Hello, I'm working on a project, where we use thymeleaf to design .html files. These are being transformed to pdf. In our case we used to "clean up" after specific elements, decorating them with

.icon-headline:after {
  content: "";
  display: table;
  clear: both;
}

This was used to make sure, float: left and such were cleared. This, let me call it, "small hack" didn't work anymore after transitioning from v.1.0.8 to v1.0.10 and our tables, border headlines and such were left all messed up. I noticed in the patchnotes a line about

711 (mixed) Better boxing for ::before and ::after content. Should now be able to define a border around pseudo content correctly.

Unfortunately this issue can't be found anymore so I decided to make one on my own in order to gain knowledge of what has happened.

I'm not sure what is meant with "better boxing" but I found out that when I use

.icon-headline:after {
  content: "";
  display: block;
  clear: both;
}

swapping to block this mechanic still works. I'm curious what has changed or why I need to swap to block because I pretty much found this out by playing around a bit.

Thanks in advance for a bit of clarification :) Phq