Last active
January 11, 2022 01:54
-
-
Save ifree/a98a7232df89cf5a8ba003227c6ad4af to your computer and use it in GitHub Desktop.
MathJax for kinopio.club
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name MathJax for kinopio.club | |
// @namespace | |
// @version 0.1 | |
// @description Enables MathJax on reddit for the TeXtheWorld delimiters [; ... ;]. | |
// @match https://kinopio.club/* | |
// @copyright | |
// @namespace https://greasyfork.org/users/399493 | |
// ==/UserScript== | |
if (window.MathJax === undefined) { | |
var polyfill_src = "https://polyfill.io/v3/polyfill.min.js?features=es6"; | |
var mathjax_src = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"; | |
var insert_script = function(src){ | |
var script = document.createElement("script"); | |
script.type = "text/javascript"; | |
// script.src = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"; | |
//script.src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML"; | |
script.src = src; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
}; | |
insert_script(polyfill_src); | |
insert_script(mathjax_src); | |
document.addEventListener('keyup', function(){ | |
MathJax.typeset(MathJax.typeset(document.querySelectorAll(".markdown span"))); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://greasyfork.org/en/scripts/438335-mathjax-for-kinopio-club