X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/a66a71bc45f176c549f227ee843875f23b71e5e4..17653d5b7ab2c7276c97b0953648fcb885383711:/edit/page.js diff --git a/edit/page.js b/edit/page.js index 9997e29..ac2288a 100644 --- a/edit/page.js +++ b/edit/page.js @@ -161,8 +161,14 @@ if (pagebody) { editlink.href = ''; editlink.onclick = undefined; pagebody.setAttribute('contenteditable', true); - pagebody.innerHTML = pagebody.innerHTML - .replace(/[^]*?/g, '$1'); + pagebody.querySelectorAll('[data-dyn]').forEach(function (el) { + let blockname = el.getAttribute('data-dyn'); + if (!blockname) { + el.remove(); + return; + } + el.outerHTML = '[[' + blockname + ']]'; + }); CKEDITOR.inline(pagebody, { customConfig: '' }); document.body.className = 'edit'; return false;