CKEDITOR.dtd.$empty['customelementnamehere'] = 1;
CKEDITOR.dtd.$block['customelementnamehere'] = 1;L[M] IS UNDEFINED
isEmpty
$block
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dtd.html
CKEDITOR.dtd.$empty['customelementnamehere'] = 1;
CKEDITOR.dtd.$block['customelementnamehere'] = 1;L[M] IS UNDEFINED
Re: Forcing a custom element to be a BLOCK-level element
Re: Forcing a custom element to be a BLOCK-level element
Re: Forcing a custom element to be a BLOCK-level element
Re: Forcing a custom element to be a BLOCK-level element
I've created a new element called <secao> used in Source mode that has only one attribute called "nome", so my element is used this way:
Inside this tag, I can have many others elements including another <secao>. My <secao> tag works like a Fieldset element (a wrapper with a label).
Well, to represent it in Visual mode, I created a few elements used in this structure:
To achieve what I want, I'm using some customized DTD like this:
// secao is a body element, so it won't be wrapped by <p> tags CKEDITOR.dtd.$body['secao'] = 1; CKEDITOR.dtd.$block['secaoview'] = 1; CKEDITOR.dtd.$block['secaotitle'] = 1; CKEDITOR.dtd.$block['secaobody'] = 1; CKEDITOR.dtd.$blockLimit['secaoview'] = 1; CKEDITOR.dtd.$blockLimit['secaobody'] = 1; // nonEditable so user can't change "nome" typing directly, it should use dialog helper CKEDITOR.dtd.$nonEditable['secaotitle'] = 1; // declaring new elements in secaoview, otherwise editor crashes CKEDITOR.dtd['secaoview'] = { 'secaotitle': 1, 'secaobody': 1 }; CKEDITOR.dtd['secaotitle'] = {'#': 1}; // secaotitle only has to have TextNode elements CKEDITOR.dtd['secaobody'] = CKEDITOR.dtd['div']; // secaoboyd should behaves and accepts whatever "div" accepts CKEDITOR.dtd['secaobody']['secaoview'] = 1; // augmenting secaobody scopes to accept another secaoview elementWell, everything is working all right, but my problem is this:
When I walk around my text using keyboard arrow keys, I can't edit my "secaotitle" element but I can walk inside with cursor inside this. When CKEditor recognizes I'm walking inside my textnode inside "secaotitle" it automatically wraps <p> around this textnode and brokes.
How do I avoid this anoying <p> wrapping my textnode inside my custom element "secaotitile"?