I am using CKEditor and what it does is add by default a <p>
at the beginning of the content.
Even if I set enterMode to be <br/>
, it will only affect what the Enter key does, and keep the starting <p>
.
The problem I have with that is that if a text starts with an <img>
tag, it will wrap the <p>
around that and the float:left
on the image has no effect anymore.
How can I stop the default <p>
from showing please?
enterMode to CKEDITOR. ENTER_BR removes the wrapping paragraph tags from CKEditor. It's worth noting that the setting changes the behavior of the enter key to insert line breaks rather than paragraphs, which is not desirable.
If you want to allow all If you want to disable Advanced Content Filter, set CKEDITOR. config. allowedContent to true. All available editor features will be activated and input data will not be filtered.
CKEditor 4 comes with a rich set of configuration options that make it possible to customize its appearance, features, and behavior. The main configuration file is named config. js . This file can be found in the root of the CKEditor 4 installation folder.
Was looking for the answer to this question also and found this link helped: http://cksource.com/forums/viewtopic.php?f=11&t=15467&hilit=prevent+%3Cp%3E
So adding this to your config.js file works:
CKEDITOR.editorConfig = function( config )
{
config.enterMode = CKEDITOR.ENTER_BR;
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With