public
Created

IntenseDebate MathJax plugin. Paste it into http://intensedebate.com/pluginEditor/ There's a bug in IntenseDebate at the moment - backslashes are stripped out of newly-posted comments, which knacks TeX thoroughly. Reloading the page gets you the correct text, slashes included.

  • Download Gist
id_mathjax_plugin.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
var id_mathjax_plugin;
(function() {
var mjp = id_mathjax_plugin = {
load_mathjax: function() {
function e(e){var t='.MathJax .mn {background: inherit;} .MathJax .mi {color: inherit;} .MathJax .mo {background: inherit;}',n=e.createElement('style');n.innerText=t;try{n.textContent=t}catch(r){}e.getElementsByTagName('body')[0].appendChild(n);var i=e.createElement('script'),s;i.src='https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML.js',i.type='text/javascript',s='MathJax.Hub.Config({skipStartupTypeset:true,tex2jax:{inlineMath:[[\'$\',\'$\']],displayMath:[[\'\\\\[\',\'\\\\]\']],processEscapes:true}});MathJax.Hub.Startup.onload();',window.opera?i.innerHTML=s:i.text=s,e.getElementsByTagName('head')[0].appendChild(i)}function t(t){t.MathJax===undefined?e(t.document):t.MathJax.Hub.Queue(new t.Array('Typeset',t.MathJax.Hub))}var n=document.getElementsByTagName('iframe'),r,i;t(window);for(r=0;r<n.length;r++)i=n[r].contentWindow||n[r].contentDocument,i.document||(i=i.parentNode),t(i)
},
process_comments: function() {
MathJax.Hub.Queue(['Typeset',MathJax.Hub,'idc-container']);
}
};
id_add_action('idcomments_init',mjp.load_mathjax);
id_add_action('idcomments_func_load',mjp.process_comments);
id_add_action('page_load',mjp.process_comments);
id_add_action('thread_page_load',mjp.process_comments);
id_add_action('comment_post',mjp.process_comments);
})();

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.