Basic MathJax hackery

This commit is contained in:
Lorenz Hübschle-Schneider 2015-03-09 15:09:32 +01:00 committed by Lorenz Hübschle-Schneider
commit 5740c647d6
2 changed files with 23 additions and 1 deletions

View file

@ -150,4 +150,17 @@ weechat.filter('emojify', function() {
};
});
weechat.filter('mathjax', function() {
return function(text, selector) {
if (text.indexOf("$$") != -1 || text.indexOf("\\[") != -1 || text.indexOf("\\(") != -1) {
// contains math
//var math = document.getElementById("MathExample");
var math = document.querySelector(selector);
MathJax.Hub.Queue(["Typeset",MathJax.Hub,math]);
}
return text;
};
});
})();