Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #315 from karlicoss/master

MathJax rendering in edit preview fixed
  • Loading branch information...
commit 247a21dcd0bce1dfe8bb63234372981126c58e99 2 parents fc1ef88 + 98147e9
@jgm authored
Showing with 7 additions and 0 deletions.
  1. +1 −0  Network/Gitit/Handlers.hs
  2. +6 −0 data/static/js/preview.js
View
1  Network/Gitit/Handlers.hs
@@ -541,6 +541,7 @@ editPage' params = do
let pgScripts'' = case mathMethod cfg of
JsMathScript -> "jsMath/easy/load.js" : pgScripts'
MathML -> "MathMLinHTML.js" : pgScripts'
+ MathJax url -> url : pgScripts'
_ -> pgScripts'
formattedPage defaultPageLayout{
pgPageName = page,
View
6 data/static/js/preview.js
@@ -10,6 +10,12 @@ function updatePreviewPane() {
if (typeof(convert) == 'function') { convert(); }
// Process any mathematics if we're using jsMath
if (typeof(jsMath) == 'object') { jsMath.ProcessBeforeShowing(); }
+ // Process any mathematics if we're using MathJax
+ if (typeof(window.MathJax) == 'object') {
+ // http://docs.mathjax.org/en/latest/typeset.html
+ var math = document.getElementById("MathExample");
+ MathJax.Hub.Queue(["Typeset",MathJax.Hub,math]);
+ }
},
"html");
Please sign in to comment.
Something went wrong with that request. Please try again.