ggrossetie / asciidoctor-web-pdf

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

STEM support is broken in release 1.0.0-alpha.7 #233

Closed ahus1 closed 4 years ago

ahus1 commented 4 years ago

The current pagedjs version 0.1.40 doesn't handle math expressions created by MathJAX.

The error message is:

> An uncaught exception happened within the HTML page: Error: TypeError: Cannot read property 'display' of undefined
    at isContainer (file:///C:/workspace/asciidoc/asciidoctor-deep-dive/asciidoctorjs/manual.html:3218:18)
    at Layout.renderTo (file:///C:/workspace/asciidoc/asciidoctor-deep-dive/asciidoctorjs/manual.html:3450:19)
    at Page.layout (file:///C:/workspace/asciidoc/asciidoctor-deep-dive/asciidoctorjs/manual.html:4066:48)
    at Chunker.layout (file:///C:/workspace/asciidoc/asciidoctor-deep-dive/asciidoctorjs/manual.html:4864:29)
    at async Chunker.renderAsync (file:///C:/workspace/asciidoc/asciidoctor-deep-dive/asciidoctorjs/manual.html:4787:17)

Example to reproduce:

= PDF created by JavaScript

:stem:

This also uses extensions to show math!

[stem]
++++
sqrt(4)^2 = 2
++++

Workaround: downgrade to 1.0.0-alpha.6

This has been fixed upstream (see https://gitlab.pagedmedia.org/tools/pagedjs/issues/190 for @Mogztter's fix), but hasn't been released in upstream yet.

This issue is to track the upstream issue and to maybe add additional test cases to catch this issue (apparently the build is green?)

ggrossetie commented 4 years ago

This issue is to track the upstream issue and to maybe add additional test cases to catch this issue (apparently the build is green?)

Indeed, we do not have a test right now but we need one!

ggrossetie commented 4 years ago

@ahus1 Paged.js 0.1.41 is out and the STEM support is working again!