twitter bootstrap - allow twitterbootstrap class-attributes on span and p tags in ckeditor -


for cms want edit content bootstrap-styles. when edit source-code in ckeditor , add class attributes gets stripped off switching wysiwyg-mode.

<p class="lead">bla</p>   =>   <p>bla</p>  

from docs can't find way allow class-attributes value p-tags.

my config default:

ckeditor.editorconfig = (config) ->   config.language = 'de'   config.contentscss = '/assets/front/application.css'   config.format_div = { element : 'div', attributes : {'data-no-turbolink' : 'true'}}    config.toolbar_pure = [     { name: 'document',    items: [ 'source','-','save','newpage','docprops','preview','print','-','templates' ] },     { name: 'clipboard',   items: [ 'cut','copy','paste','pastetext','pastefromword','-','undo','redo' ] },     { name: 'editing',     items: [ 'find','replace','-','selectall','-','spellchecker', 'scayt' ] },     { name: 'tools',       items: [ 'maximize', 'showblocks','-','about' ] }     '/',     { name: 'basicstyles', items: [ 'bold','italic','underline','strike','subscript','superscript','-','removeformat' ] },     { name: 'paragraph',   items: [ 'numberedlist','bulletedlist','-','outdent','indent','-','blockquote','creatediv','-','justifyleft','justifycenter','justifyright','justifyblock','-','bidiltr','bidirtl' ] },     { name: 'links',       items: [ 'link','unlink','anchor' ] },     '/',     { name: 'styles',      items: [ 'styles','format','font','fontsize' ] },     { name: 'colors',      items: [ 'textcolor','bgcolor' ] },     { name: 'insert',      items: [ 'image','flash','table','horizontalrule','smiley','specialchar','pagebreak' ] },   ]   config.toolbar = 'pure'   true  

you need add or chosen classes allowed content.

// allow classes allowed elements. config.extraallowedcontent = '*(*)';  // or allow class1 , class2 listed block elements , class3 listed inline ones. config.extraallowedcontent = 'p,h1,h2,h3(class1,class2); img,strong,em(class3)'; 

read more advanced content filter here: advanced content filter guide.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -