string - Why CKEditor ignores empty div or is it something else? -


i have written plugin adds bootstrap grid editor.however seems ckeditor deletes whole wrapping col div when there no content inside it.

plugin on github: https://github.com/radko26/ckeditor_layoutmanagerplugin/tree/master/layoutmanager

this default inside dom.when delete 'content', editor removes wrapping div-layout-column .

<div class="container-fluid layout-container">   <div class="row  layout-row">     <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 layout-column">            <p>content</p>      </div>     <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 layout-column">        <p>content</p>     </div>     <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 layout-column">         <p>content</p>        </div>  </div> 

i read through documentation , althought div element not stripped on default, added

 config.protectedsource.push(/<div[^>]><\/div>/g);  ckeditor.dtd.$removeempty['div'] = false; 

inside config.js.

http://docs.ckeditor.com/#!/api/ckeditor.dtd

i have thought workaround: listen editor change when layout-column no data,(i must think more part), , insert blank space prevent editor removing it, wondering if event fired when editor removes div or there easier way solve problem.

i tried solutions suggested none of them seems solve problem.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -