asciidoctor / asciidoctor-pdf

:page_with_curl: Asciidoctor PDF: A native PDF converter for AsciiDoc based on Asciidoctor and Prawn, written entirely in Ruby.
https://docs.asciidoctor.org/pdf-converter/latest/
MIT License
1.14k stars 500 forks source link

Code blocks get truncated when nested inside the description list. #2452

Closed GauntletPL closed 11 months ago

GauntletPL commented 11 months ago

When you place a code block inside the description list it is not being split between pages correctly. The first part of the code block is being rendered properly as if it was to be continued on the next page, however, nothing gets rendered on the following page.

SQL query::
+
[source, sql]
----
...
code
more code
more code
more code
more code
more code
more code
more code
more code
even more code
----

==== Schedulers
Incorrect split
image

When code block is detached from the description list it is properly split.

SQL query::

[source, sql]
----
code
more code
more code
more code
more code
more code
more code
more code
more code
more code
even more code
...
----
Correct split
image
mojavelinux commented 11 months ago

I'm not able to reproduce this. Please specify which version of Asciidoctor PDF you are using. Also, please provide a complete example that demonstrates the problem. In other words, the AsciiDoc sample itself needs to be enough to reproduce the problem without modification.

GauntletPL commented 11 months ago

I'm using Asciidoctor PDF 2.3.9 that is fetched by Asciidoc IntelliJ plugin 0.39.9. I think the key to reproduce the problem is to make the description list [horizontal].

mojavelinux commented 11 months ago

A horizontal dlist is essentially a two-column table (with no borders). In Asciidoctor PDF, a table cell cannot exceed the height of a page. Therefore, a horizontal dlist has the same limitation of tables in Asciidoctor PDF. (I'll update the docs to emphasize this fact). There's nothing we can do about this limitation.