From 963c0fdf694e3de58d125a53291b4f73c6c75d79 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 2 Mar 2023 12:43:29 +0100 Subject: [PATCH] Fix document open & increase debounce time --- src/articles/static/live-preview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/articles/static/live-preview.js b/src/articles/static/live-preview.js index f45e8ee..eaf7c27 100644 --- a/src/articles/static/live-preview.js +++ b/src/articles/static/live-preview.js @@ -41,7 +41,7 @@ function loadPreview() { return response.text(); }) .then((value) => { - preview.document.open("text/html", "replace"); + preview.document.open(); preview.document.write(value); preview.document.close(); preview.scrollTo(scrollX, scrollY); @@ -91,7 +91,7 @@ function prepareBody() { } function setupLivePreview() { - const debouncedLoadPreview = debounce(loadPreview, 200); + const debouncedLoadPreview = debounce(loadPreview, 500); function listener(event) { event.preventDefault();