X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/d3ed59c2753c2babd5aa9a1c5e0109c644904ba8..17653d5b7ab2c7276c97b0953648fcb885383711:/edit/page.js diff --git a/edit/page.js b/edit/page.js index 3071844..ac2288a 100644 --- a/edit/page.js +++ b/edit/page.js @@ -162,7 +162,12 @@ if (pagebody) { editlink.onclick = undefined; pagebody.setAttribute('contenteditable', true); pagebody.querySelectorAll('[data-dyn]').forEach(function (el) { - el.outerHTML = '[[' + el.getAttribute('data-dyn') + ']]'; + let blockname = el.getAttribute('data-dyn'); + if (!blockname) { + el.remove(); + return; + } + el.outerHTML = '[[' + blockname + ']]'; }); CKEDITOR.inline(pagebody, { customConfig: '' }); document.body.className = 'edit';