View Single Post
Old 03-31-2021, 12:31 PM   #20
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
So the path to the mathjaxfolder is built in MainWindow.cpp Perhaps the bug is there. The mathjax folder should not have a leading "/" in it, right.

From MainWindow.cpp:

Code:
#ifdef Q_OS_MAC
    // On Mac OS X QCoreApplication::applicationDirPath() points to Sigil.app/Contents/MacOS/                                   
    QDir execdir(QCoreApplication::applicationDirPath());
    execdir.cdUp();
    mathjaxurl = execdir.absolutePath() + "/polyfills/MJ/";
#elif defined(Q_OS_WIN32)
    mathjaxurl = "/" + QCoreApplication::applicationDirPath() + "/polyfills/MJ/";
#else
On MacOS it is built as an absolute path.

On Windows I am not so sure. What does QCoreApplicationDirPath() return?

But then later on we need to build a file url from it and we do it manually.

Maybe that is why the "/" is prepended?

Code:
    m_mathjaxfolder = mathjaxurl;
    mathjaxurl = mathjaxurl + "MathJax.js";
    mathjaxurl = "file://" + Utility::URLEncodePath(mathjaxurl);
    mathjaxurl = mathjaxurl + "?config=local/SIGIL_EBOOK_MML_SVG";
Perhaps we should use QUrl::fromLocalFile() here instead of building the url manually?

Last edited by KevinH; 03-31-2021 at 12:37 PM.
KevinH is online now   Reply With Quote