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

request: support for "display:contents" #880

Open jlous opened 2 years ago

jlous commented 2 years ago

In some template languages (e.g. thymelaf) it is often convenient to introduce extra "wrapper" html elements purely for template control flow reasons, even though you have no actual use for the resulting markup in the finished html.

I wish it was possible to avoid such elements from affecting the layout at all. The CSS feature "display:contents" is designed for precisely this (https://caniuse.com/css-display-contents)

It is not supported by the library of course - most browsers didn't get proper support until last year. But it would be extremely useful.