Basic MathJax hackery
This commit is contained in:
parent
f782d1e385
commit
5740c647d6
2 changed files with 23 additions and 1 deletions
|
@ -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;
|
||||
};
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue