Has anyone seen a problem where each time a message is saved, unwanted blank lines are inserted? The extra insterted lines are "<p> </p>". I am not sure yet of an exact pattern of when and why this happens. It may have something to do with Word HTML being present. I am wondering if this is a known "problem", and whether it is addressed in version 2.0 FC.
Thu, 06/16/2005 - 16:09
#1
RE: Extra lines are inserted during Save
RE: Extra lines are inserted during Save
we want to control the look of our users sites so we want to restrict this.
it does create other problems like users not being able to paste a link from on place to another in the same page.
i'd be curious to know how others are trying to deal with this issue.
it would be great to be able to let them cut and paste from within the same page without loosing formatting while forcing plain text from word.
RE: Extra lines are inserted during Save
it only happens in content that was input in older versions of fck
if you high all text in editor and remove formatting,
that corrected it for us.
we also force paste as plain text to limit what the users can paste in.
if they really need to paste in from other places we teach them to do it in source view.
RE: Extra lines are inserted during Save
I'm tempted to write a script that will manually remove these extra lines, but I wanted to document my problem first, and see if anyone had come up with a solution. Or, maybe there is a configuration setting that I am not aware of. By the way, pasting from other sources (like plain text or html from another browser) works perfectly.
Any help would be appreciated. Thanks.
RE: Extra lines are inserted during Save
Maybe this can help every PHP-developper.
When the text is submitted perform this action upon your text:
$text = str_replace("<r;p>&nbsp<r;p/>
there are also ASP-codes
It's a temporary solution dough!
RE: Extra lines are inserted during Save
If you (or others) have a thought about this, the rest of us would like to know. I will do some more experimenting to see if I can isolate the cause for the extra <p> </p> being inserted in that particular place.
RE: Extra lines are inserted during Save
RE: Extra lines are inserted during Save
I am experiencing a somehow related problem. Instead of pasting, mine is loading content into the editor. But when I load content using the
FCKeditorAPI.__Instances['FCKeditor1'].SetHTML(<i>content</i>)
the editor somehow formats that content so that when I extract whatever the editor is dipslaying through
FCKeditorAPI.GetInstance('FCKeditor1').GetXHTML()
(even without doing any editing), content is already different in terms of the number of characters.
I hope you could help me with this problem. My goal is to load html content, edit it, and save it again in the same file name. Thanks!
RE: Extra lines are inserted during Save
The reason the content changes most often is because FCKEditor uses native browser functions to format the content. Thus IE and FireFox for instance will take the exact same code and transform it, one using like <b>'s and the other <strong>'s.
I'm pretty sure just loading the code with <b> into the browser that formats bold as <strong> will transform the <b> into a <strong>, thus changing the char count.
Added to that, everything gets DOMed (turned from a page into an object and back to a page) when loaded and edited and whatnot, so things change.
There are ways to minimize the impact... CSS is a good one. If you are talking display and formatting.
If you are talking about the back end, regular expressions are your friend. If you need the source in a specific format, see how the source gets changed by various browsers and do search and replace operations to pre-process the source into the format needed.
The extra <p> </p> problem has been minimized, but there will pretty much always be issues [in my opinion]. Heck, has anyone tried to use Word on a large document that needed to have specific paragraph stuff and whatnot, like a grant proposal or some such? And having to switch between Mac and PC versions of Word? Yeeeouch.
You're far better off using some kind of publishing software if you need that kind of precision. Maybe some killer CSS type stuff.
Nothing is impossible, but some stuff is just sooooo much easier... =]
I hope this clarifies, and further than that, I hope it's [mostly] correct. Have fun with FCKEditor!
RE: Extra lines are inserted during Save
No solution yet, but here is a link pointing to reproducible error:
http://www.atceventday.com/sample_extra_lines.html
Extra blank lines (consisting of the paragraph tags) are added after the text "and stay until the drawing", before the "Sign Up Now!" table.