asciidoctor-web-pdf
asciidoctor-web-pdf copied to clipboard
Math lines at the end of a page: breaks Page.checkUnderflowAfterResize
An uncaught exception happened within the HTML page: Error: TypeError: Cannot read properties of undefined (reading 'ref')
at validNode (file:///.../test.html:3388:39)
at Layout.findEndToken (file:///.../test.html:4205:17)
at Page.checkUnderflowAfterResize (file:///.../test.html:4587:37)
at file:///.../test.html:4559:13
The AsciiDoc just needs to happen to have a math line at the end of a page. Try this:
= Some Document
:stem: latexmath
== Just 1 chapter
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
stem:[\displaystyle \frac{1}{2}]
// A line of text here will help the next math line go to the next page.
stem:[\displaystyle \frac{1}{2}]
== Next chapter
Some text.
I cannot reproduce this issue on the main branch. Here's the PDF produced: test.pdf
Your test.pdf
has enough math lines to just about fill up the 1st page. Try adding more so that they overflow to the 2nd page?
It also works test.pdf Do you use a custom style? Could you please try with the latest version?