ggrossetie / asciidoctor-web-pdf

Convert AsciiDoc documents to PDF using web technologies
https://asciidoctor.org
MIT License
443 stars 90 forks source link

styling a (sub-)chapter using a selector based on pagedjs_page[style*=''] prevents page to fit content #646

Closed benoitrolland closed 2 years ago

benoitrolland commented 2 years ago

Styling the content of a given (sub-)chapter can be done using a selector based on the <h(1-N)> node, using its [data-id="_subchaptername"] attribute. If the style applied reduce the height of the content, the content is well rechaped to fill the page by including next lines initially located on next page.

But the next page of the (sub-)chapter will not be styled since no <h(1-N)> node is avalaible there.

The selector I found to match the whole sub-chapter is the following: .pagedjs_page[style*='--pagedjs-string-last-current-sub-chapter:"Sub-Chapter Name";']

But using this selector doesn't result in next lines beeing included in previous page to fill the remaining space, this result in

Would you be aware of such a problem and have an idea of how to style a multi-pages sub-chapter having its content fiting the space available ?