Skip to content

Instantly share code, notes, and snippets.

@christianp
Created August 29, 2013 10:44
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save christianp/6376614 to your computer and use it in GitHub Desktop.
Save christianp/6376614 to your computer and use it in GitHub Desktop.
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.
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);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment