From e1a0e6a03e8f97c87e2549694d41bccae190848f Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 3 Feb 2023 05:04:23 +0200 Subject: [PATCH] make images expandable in markdown preview --- files/assets/js/markdown.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/assets/js/markdown.js b/files/assets/js/markdown.js index 698716e93..98dcfe09b 100644 --- a/files/assets/js/markdown.js +++ b/files/assets/js/markdown.js @@ -96,6 +96,11 @@ function markdown(t) { input = input.replace(/\n\n/g, '
') document.getElementById(t.dataset.preview).innerHTML = input + + const expandable = document.querySelectorAll('img[alt]'); + for (const element of expandable) { + element.onclick = () => {expandImage()}; + } } function charLimit(form, text) {