Fix js toggle

This commit is contained in:
Hakan Ensari 2018-09-11 18:41:51 +01:00
parent 97e47b4797
commit 5467b1b50e

View File

@ -3,7 +3,7 @@ hljs.initHighlightingOnLoad();
// Make URLs clickable
document.querySelectorAll('.http').forEach((element) => {
element.onclick = () => {
if (element.innerHTML.indexOf('\n') > -1) {
if (element.innerHTML.indexOf('json') > -1) {
const output = element.innerHTML.match(/^(.*)\n/)[1];
element.innerHTML = output;
} else {