From 816fb04bea9fc359d5cae4a1b243c2f58d4cd0e0 Mon Sep 17 00:00:00 2001 From: Gwendolyn Date: Tue, 5 Dec 2023 17:20:01 +0100 Subject: [PATCH] fix that stupid mobileclient bug in the editor --- src/c3nav/editor/static/editor/js/editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index 8d08f712..c4dc07cd 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -176,7 +176,8 @@ editor = { // sidebar was loaded. load the content. check if there are any redirects. call _check_start_editing. var content = $('#sidebar').removeClass('loading').find('.content'); if (data !== undefined) { - content.html($(data)); + var doc = (new DOMParser).parseFromString(data, 'text/html'); + content[0].replaceChildren(...doc.body.children); } var redirect = content.find('span[data-redirect]');