Is there a way to disable the auto paragraph feature? Some of the content I deal with should not have paragraph markup around it. This was not a problem in 2.3, but I just upgraded to 2.5, and the editor automatically enters <p> </p> around this content (as well as images) when I submit the form containing the FCKEditor.
In source code mode, here's what I submit:
Upon submission, (and I can watch the editor apply the paragraph), the source code is changed to:
It seems like the editor is trying to be smart... but I don't want it to be. There must be a way to turn this off... yes? Please??!!!
In source code mode, here's what I submit:
<img src="image/test.gif" alt="" /> <h1>Above this heading is an image and it shouldn't have a paragraph around it.</h1> <p>Just below this paragraph, a CMS extension is being called and I don't want it to be wrapped in a paragraph either:</p> #CMSExtensionName(param1="this", param2="that")#
Upon submission, (and I can watch the editor apply the paragraph), the source code is changed to:
<p><img src="image/test.gif" alt="" /> </p> <h1>Above this heading is an image and it shouldn't have a paragraph around it.</h1> <p>Just below this paragraph, a CMS extension is being called and I don't want it to be wrapped in a paragraph either:</p> <p>#CMSExtensionName(param1="this", param2="that")#</p>
It seems like the editor is trying to be smart... but I don't want it to be. There must be a way to turn this off... yes? Please??!!!
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
You can find the settings you need to change in fckconfig.js. You can also change the settings without modifying fckconfig.js, refer to the HTML file _samples/html/sample12.html for how to do that.
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
I am not complaining about paragraphs or breaks inserted, when i hit enter. Since that is exactly what should happen. But as long as i don't hit enter, there is no reason to insert anything.
The editor does not know, where the Text will be used afterward. Perhaps (and in my case quite often) it will be injeceted into another line of text. And in emphasising 'line' i mean 'line', but not a stand alone block.
I don't want the editor to insert a wrapping paragraph without me asking for it. It should not make assumption about things it can't possibly know.
Funny thing about the 'solution' regarding p vs. br ... I just did this:
Meaning: i open the page containing the editor, this piece of JS switches the editor directly to source-view. The editor was empty to begin with, and no text was automatically inserted.
> when in p-mode, the source-view is empty (just as it should be)
> when in br-mode, there is a lonley <br />
So ... using <br /> is in no way a valid solution to the original problem.
Re: Disable Auto-paragraph feature?
The same goes for me too: I like the way the default EnterMode works, but the automatically added <p></p> seriously screws up my markup.
This is a serious problem for me.
I haven't been able to find a solution in the archives. Is there any?
Thanks for any cluesticks and RTFMs...
Nanook
Re: Disable Auto-paragraph feature?
This is a big struggling issue for me too and I spend quite many hours to find a solution. I noted this problem only with users who use IE (with FF it works fine without <p></p>). Setting FCKConfig.EnterMode = 'br' doesn't help.
I found out that when the HTML/Text box is really empty the <p></p> doesn't appear. The same happens when I edit the EditHtml.ascx.resx and set AddContent.Text as empty. The problem appears in IE when I select existing text (within FCKeditor) and overwrite it with new content.
I hoped with the new release 2.6 this problem would be fixed - but it isn't. For me this is a major issue and I would appreciate if there would be a solution here.
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
When EnterMode='p' or 'div', the editor "guarantees" that all inline elements and text will be properly. In this way developers can safely assume that the content produced with the editor is standards compliant.
If you instead need that part of the source code to remain untouched while editing, then the ProtectedSource setting comes on help. You may use it to register a regular expression that will save your special tags from being changed.
@vishalg: if your one post to our "community" forums is all you can do to contribute, there is no much lucky for you here, sorry.
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
is there any solution available now ? I really dont want to have the paragraph used when no paragraph has been specified eg: I am loading plain text from a DB which originally doesn't have any P around it and when its loaded in FCK it automatically adds the paragraph around, while its fine to have the paragraph I dont think its a good idea to force existing content which is loaded at first to be surounded with P.
Hopefully there is a way to disable this behavior.
Thanks a lot,
Thomas
Edit : Ok I've used the 'div' option in the config file which works fine in my case however I still believe that it would be a good idea to somehow make this auto-tagging on startup optional. Thanks for this great editor.
Re: Disable Auto-paragraph feature?
Thanks,
SP
Re: Disable Auto-paragraph feature?
This is a big issue for me too
I am now trying to down grade to a release that did not have this feature 2.3 I think but cant find a download .
I have tried the br and div still fecks my code.
Will this be dealt with in the next release ?
Re: Disable Auto-paragraph feature?
Typing in text from scratch results in the correct html-code separated by <br>'s.
Still I got a two problems, pasted Text from other sources is still misstreated with the <P></P>'s instead of <br/>'s.
Another ugly thing is, if you try to get rid of different styles from your pasted text by 'mark all and switching to another font and size'. This is sometimes not working properly. Looking at the source there are still things like <font face="Helv" size="2"> left -.-
Re: Disable Auto-paragraph feature?
I have made some basic code that does the trick of having the version 2.6.3 behave more or less like the 2.3, for the case you want to have a <p> on Enter, but no 'auto-paragraph'.
Just add the following code in your fckconfig.js
This "fix" is done by setting
and redefining the handler of FCKEnterKey with
So with this change if you have an empty fckeditor where you type (without typing enter)
When you do a view source you have only
instead of
It is the smallest and simplest solution I have found. It seems quite difficult to change the way FCK handle FCKConfig.EnterMode (which lead to the auto-paragraph "feature"), as it is used many ways in many places.
I have tested with firefox 2-3, google chrome and internet explorer 7-8.
Maybe it can help someone very annoyed by this problem.
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
In fact the problem lies in the EnterMode handling of FCK. If you use EnterMode='br', you will not see the auto-<p>( or auto-<div>) "feature".
Let's say you have typed in a empty fckeditor
When you do a 'View source', if you have EnterMode='div', you will see
If EnterMode was 'p' you will see
I agree with you by the way that it semantically wrong; I hope they will take care of it.
Re: Disable Auto-paragraph feature?
thanks for your fix - it works for me if i edit existing textfields. But everytime i start a new blank field my "view source" shows me instead of beeing clean and blank. Tested with FF 3.03.
I can't believe that theres no way to disable the auto-paragraph "feature" - hmmm ??
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
Your sample code worked great, to help me over come some mark up issues!
And my thanks to the FCKeditor team! Keep up the good work
Re: Disable Auto-paragraph feature?
The source code is exactly the same:
In Firefox 3.0.5, the source code still gets a <br/> tag at the end:
Has anyone else noticed that, and if so is there a fix? I can remove the <br/> in "source" view and it keeps the change, but I'd prefer it to work as it does in IE 7, with no <br/> at all.
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
Re: Disable Auto-paragraph feature?
This sets the padding to zero on all <p>s that are direct parents of images. It is not the most elegant solution, but it works for me.
Re: Disable Auto-paragraph feature?
why dont you just write a quick little function to remove the <p> when processing the data.
quick and easy