init: function(editor) {
editor.addCommand( 'inlinesave', {
exec: function (editor) {
init: function(editor) {
editor.addCommand( 'inlinesave', {
exec: function (editor) {
// empty line is equivalent to a paragraph break
body = body.replace(/<br \/>\s*<br \/>/g, '<p>');
// wrap long line after each sentence
// empty line is equivalent to a paragraph break
body = body.replace(/<br \/>\s*<br \/>/g, '<p>');
// wrap long line after each sentence
editlink.href = '';
editlink.onclick = undefined;
pagebody.setAttribute('contenteditable', true);
editlink.href = '';
editlink.onclick = undefined;
pagebody.setAttribute('contenteditable', true);
- pagebody.innerHTML = pagebody.innerHTML
- .replace(/<!--BLOCK:(.*?)-->[^]*?<!--\/-->/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;
CKEDITOR.inline(pagebody, { customConfig: '' });
document.body.className = 'edit';
return false;