Opened 9 years ago

Last modified 9 years ago

#13414 closed Bug

Don't wrap wiget editable div content in 'P' Block. — at Initial Version

Reported by: sweta Owned by:
Priority: Normal Milestone: CKEditor 4.5.3
Component: UI : Widgets Version:
Keywords: Cc:

Description

I have created custom plugin for ckeditor widget "MyWiget" This plugin definition is given below.

CKEDITOR.plugins.add( 'MyWidget', {

requires: 'widget',

icons: 'MyWidget',

init: function( editor ) {

editor.widgets.add( 'MyWidget', {

allowedContent: 'div(!My_Div);table(!My_tbl);td(!My_td);tr(!My_tr);',

requiredContent: 'table(My_tbl)',

editables: {

content: {

selector: '.My_Div', allowedContent: 'span a strong sub sup u em s br ul ol li h1 h2 h3 h4 h5 h6 hr; a[!href,name,id,style]; span[!style]{color}; '

}

},

template:'<table mode="0" class="My_tbl ckw_contentTextWidget" border="0" cellpadding="0" cellspacing="0" align="center"><tbody><tr class="My_tr"><td class="My_td" valign="top" bgcolor="#FFFFFF" style="text-align : center"><div class="My_Div" style="text-align : left;">Enter your text here...<br>&nbsp;<br>&nbsp;</div></td></tr><tbody></table>',

button: 'Text',

upcast: function( element ) {

return element.name == 'table' && element.hasClass( 'My_tbl' );

},

data: function(){

}

} );

}

} );

currently I am using ckeditor 4.4.7. and I have configured config file as below. config.enterMode = CKEDITOR.ENTER_BR; config.shiftEnterMode = CKEDITOR.ENTER_BR; config.autoParagraph = false;

Now when I click in the editable div "My_Div" the content [Enter your text here...<br>&nbsp;<br>&nbsp;] is wrapped in enclosing p tag. [<p>Enter your text rest here...<br>&nbsp;<br><br></p>]. So I don't want to wrap content of div in p block. Any help will be appreciated.

Change History (0)

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy