mirror of
https://github.com/typecho/plugins.git
synced 2025-01-22 13:41:34 +08:00
13 lines
442 B
JavaScript
13 lines
442 B
JavaScript
|
(function() {
|
||
|
var $ = document.querySelectorAll.bind(document);
|
||
|
var latex = $('code.lang-laTex, code.lang-latex, code.lang-tex');
|
||
|
for (var i = 0, l = latex.length; i < l; i++) {
|
||
|
var node = latex[i];
|
||
|
var latex_image = document.createElement("img");
|
||
|
latex_image.src = "http://latex.codecogs.com/png.latex?"+ node.innerHTML;
|
||
|
|
||
|
var parent = node.parentNode;
|
||
|
parent.insertBefore(latex_image, node);
|
||
|
parent.removeChild(node);
|
||
|
}
|
||
|
})();
|