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';