Mathjax rendering doesn't work on self-hosted instances of drawio docker image.
See original GitHub issuePreflight Checklist
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Describe the bug Mathjax rendering doesn’t work since major 20.0.0 release upgrade on self-hosted instances of drawio docker image.
To Reproduce Steps to reproduce the behavior:
- Install self-hosted docker image of drawio tag >=20.0.0
- Create, open a file.
- Check Menu–>Extras–>Mathematical Typesetting tick is on
- Add text or rectangle with any Latex mat code, e.g.
$$\alpha^2$$
- Actually it’s remained unrendered…
Expected behavior
draw.io version (In the Help->About menu of the draw.io editor):
- Tried different versions: 20.2.5, 20.2.6, 20.0.3
Logs of docker container
root@4606b9ece5e6:/usr/local/tomcat# cat logs/localhost_access_log.2022-11-07.txt
172.221.0.3 - - [07/Nov/2022:13:53:22 +0000] "GET / HTTP/1.1" 200 13349
172.221.0.3 - - [07/Nov/2022:13:53:22 +0000] "GET /styles/grapheditor.css HTTP/1.1" 200 50988
172.221.0.3 - - [07/Nov/2022:13:53:22 +0000] "GET /js/PreConfig.js HTTP/1.1" 200 1413
172.221.0.3 - - [07/Nov/2022:13:53:22 +0000] "GET /js/app.min.js HTTP/1.1" 200 7815751
172.221.0.3 - - [07/Nov/2022:13:53:22 +0000] "GET /mxgraph/css/common.css HTTP/1.1" 200 4325
172.221.0.3 - - [07/Nov/2022:13:53:22 +0000] "GET /js/PostConfig.js HTTP/1.1" 200 252
172.221.0.3 - - [07/Nov/2022:13:53:22 +0000] "GET /resources/dia.txt HTTP/1.1" 200 43499
172.221.0.3 - - [07/Nov/2022:13:53:22 +0000] "GET /favicon.ico HTTP/1.1" 200 15086
172.221.0.3 - - [07/Nov/2022:13:53:22 +0000] "GET /math/startup.js HTTP/1.1" 404 770
Last line reports Error 404 for “GET /math/startup.js HTTP/1.1” 404
Analysis
hosting-your-own-copy-of-the-mathjax-components tells that need to move content of es5
folder to <path-to-server-location>/math
however it still remained in es5
, it can be checked in a recent tag codebase: https://github.com/jgraph/drawio/tree/v20.5.3/src/main/webapp/math/es5
Seems that main application doesn’t use local instances of mathjax from webapp/math
folder rather gets it directly from a CDN on the web… Thus there is no such issue on local app or on global server instance.
Workaround
Inside a container move all contents from webapp/math/es5/*
to upper level webapp/math
:
docker exec -it self-contained_drawio_1 mv webapps/draw/math/es5/* webapps/draw/math
Proposed Solution
Repeat moving content of es5
folder in jgraph/drawio codebase
or
if for some reason it is still necessary to keep es5
folder then add es5
content moving command to https://github.com/jgraph/docker-drawio/blob/dev/main/Dockerfile
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
I’ve tried and it works. Can you please send us detailed steps to reproduce
Will be fixed in the next release. Thanks