mirror of
https://github.com/typecho/plugins.git
synced 2024-12-21 20:40:08 +08:00
13 lines
465 B
JavaScript
13 lines
465 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;
|
|
// replace with image
|
|
var parent = node.parentNode;
|
|
parent.insertBefore(latex_image, node);
|
|
parent.removeChild(node);
|
|
}
|
|
})(); |