diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-08-30 22:11:29 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-08-30 22:11:29 -0400 |
commit | b89d5788196bea63dfc1d2feb9619ff7bb7666d0 (patch) | |
tree | 58fa1473dfc73d9a67be5bed4766625b3630226b | |
parent | 4fc5a5f43f7c7900face96e89a2f3791bfc6ff15 (diff) | |
download | askbot-b89d5788196bea63dfc1d2feb9619ff7bb7666d0.tar.gz askbot-b89d5788196bea63dfc1d2feb9619ff7bb7666d0.tar.bz2 askbot-b89d5788196bea63dfc1d2feb9619ff7bb7666d0.zip |
made mathjax rendering kinda work in previewer
-rwxr-xr-x | askbot/skins/default/media/js/wmd/showdown.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/askbot/skins/default/media/js/wmd/showdown.js b/askbot/skins/default/media/js/wmd/showdown.js index e2c6fb61..257b8bd1 100755 --- a/askbot/skins/default/media/js/wmd/showdown.js +++ b/askbot/skins/default/media/js/wmd/showdown.js @@ -92,8 +92,7 @@ var g_html_blocks; // (see _ProcessListItems() for details): var g_list_level = 0; - -this.makeHtml = function(text) { +var makeHtmlBase = function(text) { // // Main function. The order in which other subs are called here is // essential. Link and image substitutions need to happen before @@ -155,6 +154,22 @@ this.makeHtml = function(text) { return text; } +this.makeHtml = function(text){ + if (enableMathJax === false){ + return makeHtmlBase(text); + } + else { + MathJax.Hub.queue.Push( + function(){ + $('#previewer').html(makeHtmlBase(text)); + } + ); + MathJax.Hub.Queue(['Typeset', MathJax.Hub, 'previewer']); + return $('#previewer').html(); + } +} + + var _StripLinkDefinitions = function(text) { // // Strips link definitions from text, stores the URLs and titles in |