From 78cf5fa770776c88688cf19c83fdf12831c20cc0 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 16 Mar 2021 18:19:53 +0100 Subject: [PATCH] Fix bug in markdown preview of new objects Whens submitting a new object, the instructions for how to do markdown didn't show up until after the object had been saved once. This turns out to be because the performance optimization to take an empty string markdown and turn it into an empty string html wrote the (empty) result to the wrong field, thereby overwriting the instructions. --- media/js/markdown_preview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/js/markdown_preview.js b/media/js/markdown_preview.js index fdf9bdd6..5546e265 100644 --- a/media/js/markdown_preview.js +++ b/media/js/markdown_preview.js @@ -67,7 +67,7 @@ function update_markdown(obj) { function _do_update_markdown(obj) { if (obj.value == '') { /* Short-circuit the empty field case */ - obj.infospan.innerHTML = ''; + obj.preview_div.innerHTML = ''; return; } -- 2.39.5