plantuml-gitea/plantuml.js

17 lines
464 B
JavaScript

/*
* Copyright (C) 2022 <<ewe>>yn
* https://git.vdm.dev/octoleo/plantuml-gitea
* MIT License
*
*/
function plantUML(url = 'http://www.plantuml.com/plantuml') {
$(document).ready(function() {
$(".language-uml").each(function() {
plantuml_text = unescape(encodeURIComponent(this.innerText));
this.closest(".code-block").outerHTML =
"<img src=\"" + url + "/img/" + encode64(PlantUML.deflate(plantuml_text, 9)) + "\">";
});
});
}