MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Bug in Preview with epubs that contain MathML equations? (https://www.mobileread.com/forums/showthread.php?t=340013)

DiapDealer 06-15-2021 01:08 PM

I'll check Linux with the system MathJax 2 later on today sometime (unless someone beats me to it). ;)

DiapDealer 06-15-2021 05:47 PM

OK. The bad news is that regardless of this latest change, MathJax rendering isn't working at all with the system mathjax2 on my Arch system. Even with the stock pacman version of Sigil 1.6.0. Inspector shows that the local config is being properly installed and found.

I'll need to find out what's going on there before I can test the latest Preview sync changes.

DiapDealer 06-15-2021 06:13 PM

I take that back. The mathjax url isn't being properly built whenever the system mathjax is being used. There's a path separator missing. It was probably the last change we made to get Mathjax working again on Windows. It works for the bundled mathjax build, just not when the -DMATHJAX_DIR= cmake directive is provided (and the provided path doesn't end with a forward slash).

DiapDealer 06-15-2021 06:15 PM

Other than that, it looks like your latest MathJax sync fixes will indeed work with the Linux system mathjax2 (once I figure out what's going wrong with the url building under that special-cased situation).

KevinH 06-15-2021 06:47 PM

Glad to hear it works on Linux once the injected url is fixed!

DiapDealer 06-15-2021 07:00 PM

Yeah. We broke mathjax rendering on any repo versions of Sigil that specify -DMATHJAX_DIR (which may only be Arch right now) starting with Sigil 1.5.1. It's a pretty easy fix, but I want to make sure it's handled in a way that doesn't change how packagers specify the system MathJax location in their existing build scripts.

Everything will already work on Linux for those who use our bundled mathjax. It's only the packagers who debundle with -DMATHJAX-DIR who are affected.

KevinH 06-15-2021 07:09 PM

Given the code in MainWindow.cpp, mathjax_dir needs to end with a '/' or we can not just append MathJax.js

Perhaps we check if mathjax_dir.endsWith('/') and if not append one for linux/unix

DiapDealer 06-15-2021 07:25 PM

A *nix check for the slash might be best. Otherwise, a broken url with two forward slashes is technically possible if someone provides a path that end in a slash via MATHJAX_DIR (and we automatically append one in all cases).

Why is there nothing as handy as Python's os.path.join, so we could avoid concatenating with slashes altogether? :D

KevinH 06-15-2021 07:36 PM

Please push whatever you think best.

DiapDealer 06-15-2021 07:47 PM

I like your idea of checking if it ends with a slash, and adding it if not (*nix only). That's probably what I'll do.

DiapDealer 06-15-2021 09:16 PM

https://github.com/Sigil-Ebook/Sigil...ac8dd0637f6d5b

KevinH 06-15-2021 11:30 PM

Thanks!


All times are GMT -4. The time now is 10:31 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.