diff --git a/src/resources/vnote.ini b/src/resources/vnote.ini index d5462917..6d39595a 100644 --- a/src/resources/vnote.ini +++ b/src/resources/vnote.ini @@ -119,6 +119,10 @@ confirm_images_clean_up=true ; Confirm before reloading folder from disk confirm_reload_folder=true +[web] +; Location and configuration for Mathjax +mathjax_javascript=https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML + [session] tools_dock_checked=true diff --git a/src/utils/vutils.cpp b/src/utils/vutils.cpp index 1ab7d59d..d140035f 100644 --- a/src/utils/vutils.cpp +++ b/src/utils/vutils.cpp @@ -561,7 +561,7 @@ QString VUtils::generateHtmlTemplate(MarkdownConverterType p_conType, bool p_exp " showProcessingMessages: false,\n" " messageStyle: \"none\"});\n" "\n" - "\n" + + "\n" + "\n"; } diff --git a/src/vconfigmanager.cpp b/src/vconfigmanager.cpp index 62bbf0e4..4439b3f7 100644 --- a/src/vconfigmanager.cpp +++ b/src/vconfigmanager.cpp @@ -213,6 +213,9 @@ void VConfigManager::initialize() m_confirmReloadFolder = getConfigFromSettings("global", "confirm_reload_folder").toBool(); + + m_mathjaxJavascript = getConfigFromSettings("web", + "mathjax_javascript").toString(); } void VConfigManager::readPredefinedColorsFromSettings() diff --git a/src/vconfigmanager.h b/src/vconfigmanager.h index 85402787..48e15c59 100644 --- a/src/vconfigmanager.h +++ b/src/vconfigmanager.h @@ -277,6 +277,8 @@ public: bool getConfirmReloadFolder() const; void setConfirmReloadFolder(bool p_enabled); + const QString &getMathjaxJavascript() const; + // Return the configured key sequence of @p_operation. // Return empty if there is no corresponding config. QString getShortcutKeySequence(const QString &p_operation) const; @@ -557,6 +559,9 @@ private: // Confirm before reloading folder from disk. bool m_confirmReloadFolder; + // Location and configuration for Mathjax. + QString m_mathjaxJavascript; + // The name of the config file in each directory, obsolete. // Use c_dirConfigFile instead. static const QString c_obsoleteDirConfigFile; @@ -1468,4 +1473,9 @@ inline void VConfigManager::setConfirmReloadFolder(bool p_enabled) m_confirmReloadFolder); } +inline const QString &VConfigManager::getMathjaxJavascript() const +{ + return m_mathjaxJavascript; +} + #endif // VCONFIGMANAGER_H diff --git a/src/vnote.cpp b/src/vnote.cpp index b74880eb..6c54e484 100644 --- a/src/vnote.cpp +++ b/src/vnote.cpp @@ -44,8 +44,6 @@ const QString VNote::c_mermaidForestCssFile = ":/utils/mermaid/mermaid.forest.cs const QString VNote::c_flowchartJsFile = ":/utils/flowchart.js/flowchart.min.js"; const QString VNote::c_raphaelJsFile = ":/utils/flowchart.js/raphael.min.js"; -const QString VNote::c_mathjaxJsFile = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"; - const QString VNote::c_highlightjsLineNumberExtraFile = ":/utils/highlightjs/highlightjs-line-numbers.min.js"; const QString VNote::c_shortcutsDocFile_en = ":/resources/docs/shortcuts_en.md"; diff --git a/src/vnote.h b/src/vnote.h index 1ef882d9..a5f73cbc 100644 --- a/src/vnote.h +++ b/src/vnote.h @@ -62,9 +62,6 @@ public: static const QString c_flowchartJsFile; static const QString c_raphaelJsFile; - // Mathjax - static const QString c_mathjaxJsFile; - // Highlight.js line number plugin static const QString c_highlightjsLineNumberExtraFile;