Bug: Editor inserts empty line at the beginning of the text

Aug 2, 2012 at 2:46 PM
Edited Aug 2, 2012 at 2:46 PM

Hi.

i've upgraded ck editor for dnn. 

I am using CKHtmlEditorProvider_1.14.05_Install_Complete. DNN version 5.6, FW 4.0. 

On some documents editor adds 2 new empty lines on the top of the document after each save, so text of the document floats deeper and deeper down by 2 lines each save: 

 

<p>&nbsp;</p>
<p>&nbsp;</p>
Aug 2, 2012 at 2:51 PM

Switching between Source and Design view adds empty lines as well!

Aug 2, 2012 at 3:23 PM

One thing was causing it. If document has some link tag in it, than it adds empty lines, if not it stays ok:

<link href="styles.css" rel="StyleSheet" />
Which other tags will cause this?

Aug 2, 2012 at 3:25 PM

Also meta tag causes it...

Coordinator
Aug 2, 2012 at 3:27 PM
lukalev wrote:

Hi.

i've upgraded ck editor for dnn.

I am using CKHtmlEditorProvider_1.14.05_Install_Complete. DNN version 5.6, FW 4.0.

On some documents editor adds 2 new empty lines on the top of the document after each save, so text of the document floats deeper and deeper down by 2 lines each save:

 

<p>&nbsp;</p>
<p>&nbsp;</p>

This is not a Bug its a feature...

http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.enterMode

You can change the behaviour by edit the config,js to switch to br tags

config.enterMode = CKEDITOR.ENTER_BR;

But there is no way to turn the behavior off completely

Aug 3, 2012 at 11:23 AM

Dear Watcha.

whats is the purpose of this feature? It adds blank new lines when switching between design and code mode and adding blank lines after user saves an edited document? To me and users on our portal this is annoying :(

Thanks.

Coordinator
Aug 3, 2012 at 3:56 PM
lukalev wrote:

Dear Watcha.

whats is the purpose of this feature? It adds blank new lines when switching between design and code mode and adding blank lines after user saves an edited document? To me and users on our portal this is annoying :(

Thanks.

From what i understand this feature wraps all elements with an p tag however in some cases when an an empty paragraph is in html it get wrapped with the <p>&nbsp;</p>.

What you could try is setting the following options to fals

config.fillEmptyBlocks = false;
 config.ignoreEmptyParagraph = true;

config.enterMode = CKEDITOR.ENTER_BR;

Aug 9, 2012 at 11:26 AM

No, it does not help. My temporary workaround was to replace all tags that cause empty lines with span:

TextEditor.Text = content.ToLower().Replace("<meta", "<span").Replace("<link", "<span").Replace("</meta>", "</span>").Replace("</link>", "</span>").Replace("title>", "span>")

Another thing happend today. Editor showed links in white color (so they weren't visible) in one document. After switching between Code view and Design view, they became visible :)

Can't wait for new CK editor upgrade...

Thanks,
Luka 

Coordinator
Aug 9, 2012 at 12:29 PM
lukalev wrote:

No, it does not help. My temporary workaround was to replace all tags that cause empty lines with span:

TextEditor.Text = content.ToLower().Replace("<meta", "<span").Replace("<link", "<span").Replace("</meta>", "</span>").Replace("</link>", "</span>").Replace("title>", "span>")

Another thing happend today. Editor showed links in white color (so they weren't visible) in one document. After switching between Code view and Design view, they became visible :)

Can't wait for new CK editor upgrade...

Thanks,
Luka

  You could try the latest BETA 1.14.06 which contains the latest CKEditor release

http://dnnckeditor.codeplex.com/releases/view/88691