Hi,
Can anyone help? The current behaviour of the Editor is to wrap inline items in <p> tags.
eg, open the source viewer, type in 'test', then open and close the source view, and the text now reads '<p>test</p>'.
Accoring to the following doc, this behaviour is enforced by the editor when using the default entermode:
"Also , when EnterMode is set to 'p' or 'div', the editor guarantees that inline elements, like text and images, will be always hold by block elements. "
(http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options/EnterMode)
I understand I can change the 'Entermode', to wrap content in either a DIV, P or BR. However I want to retain the default 'Entermode' (p for carriage return, br for shift-return), but PREVENT the editor from wrapping inline elements (such as text and images) from being wrapped in <P> tags.
Can anyone help?
Best,
Bilf
Tue, 05/12/2009 - 13:38
#1
Re: Stop wrapping inline content in <P> tags, with default
and change settings to
FCKConfig.EnterMode = 'br' ; // p | div | br
FCKConfig.ShiftEnterMode = 'p' ; // p | div | br
after you do this clear your browser cache, restart browser, etc.
Had the exact same problem and it definitely works now for IE.
Re: Stop wrapping inline content in <P> tags, with default
Thanks for the reply, but I have to retain the default enter mode of:
FCKConfig.EnterMode = 'p' ; // p | div | br
FCKConfig.ShiftEnterMode = 'br' ; // p | div | br
While preventing inline content being auto-wrapped in <p> tags. I don't think there is a switch in the config file for this behaviour, but it's something we require.
I don't mind editing the editor source to achieve this behaviour - I'm just not sure where to start looking.
Thanks again for the suggestion- but any other ideas?
Best,
Bilf
Re: Stop wrapping inline content in <P> tags, with default
Try to set EnterMode='' (empty).
Now, fck don't wrap your contents with <p> but if you do a carriage return, it does it.
But it seems to make problem where save or edit source (content disappear...)
Maybe you can modify source (there is a function FixBody in fck.js witch seem to make the replacement only if EnterMode= p or div :
I tried to transform this in :
so if EnterMode=p, fixBody don't force wrap with <p>
It seems to work but i have no time to really test
Re: Stop wrapping inline content in <P> tags, with default
Hope this is of use to you.