Restore pauses during webpdf render #2025
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
nbconvert recently adopted playwright for webpdf output. This pull request restores two 100ms timeouts that existed previously but were omitted from the new rendering chain.
Without the timeouts webpdf output can include a gray "Loading [MathJax]/jax/output/CommonHTML/fonts/TeX/fontdata.js" boxed message in the footer and MathJax has not processed the page.
A simple example can be created as follows:
Viewing the resulting
test.pdf
will have the grey box in the footer with the loading mathjax message. Generatinghtml
version using the same command and viewing the html in a browser shows that the message flashes briefly before disappearing. The 100ms pause seems to have avoided that in the past.There may be better ways to ensure MathJax and other things have completed rendering (playwright documentation discourages use of
wait_for_timeout
and it might be a good idea to make the timeout available as a command line option in case some very slow javascript needs to run), but this should at least more closely emulate the previous behavior.