This is a migrated thread and some comments may be shown as answers.

NewLineBr and paragraph tags for first paragraph

6 Answers 142 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Rod
Top achievements
Rank 1
Rod asked on 18 Jul 2008, 07:55 PM
Hi -

I have the NewLineBr set to false, and the editor correctly wraps each paragraph in <p> tags - except the first paragraph.  Is there a way to get the editor to wrap the first paragraph in p-tags as well?

Thanks,

Rod

6 Answers, 1 is accepted

Sort by
0
Rod
Top achievements
Rank 1
answered on 19 Jul 2008, 10:48 PM
This problem crops up in Firefox only.  I also get an error showing up in Firebug:

Permission denied to get property XULElement.accessibleType
_7f7.close();

Any ideas?

Thanks,

Rod
0
Rumen
Telerik team
answered on 22 Jul 2008, 11:10 AM
Hi Rod,

The default behavior of the Enter command in Mozilla (Gecko) editors is to insert a <br> tag. In order to provide support for paragraph insertion under Firefox we made a custom implementation (NewLineBr="false") which has its limitations because of the different browser problems and behaviors. The observed behavior is a side effect of our code and it is not an easy task to workaround or fix it. The problem is logged in our ToDo list and if possible we will fix it in one of the future versions of RadEditor.

In the meantime our suggestion is to set NewLineBr="true" which will insert the default <br> tags instead of <p> tags.

In regards to the reported js error: we are not aware of it. Could you please, provide step-by-step instructions on how to reproduce the error and sample content for test? Are you able to reproduce it with the Futures build of RadEditor?


Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jeff
Top achievements
Rank 1
answered on 21 Apr 2009, 12:26 AM
I would like to see this fixed as well. I've even came up with a term to describe the phenomena: Orphaned text.

This defined as text that is not enclosed by any tags and rightly belongs in a <p> tag.

I also want to point out this is not limited to the first line. Once you have orphaned text, it can result in additional lines of orphaned text.

Here's something I observed:

  1. Start with a completely empty editor.
  2. Type something on the first line and hit enter. This inserts a <br /> after the line.
  3. Type a second line of text and hit enter. This is properly enclosed in <p> tags.
  4. Press the down arrow. You are now on the line terminated by the <br /> inserted in step 2.
  5. Type some text and press enter. You have another line of orphaned text.
  6. Repeat steps 3 and 5 to get additional lines orphaned text.

For my situation, the ideal fix is to prevent that <br /> from ever being created. Instead, after hitting enter on the first line, wrap it in <p> tags. This both prevents the cascade effect described above and properly encloses the first line in the p tag.

It's quite possible I'm not considering all the factors in play here. If so, I'd like to hear why this solution wouldn't work.

Thanks,
Jeff
0
Rumen
Telerik team
answered on 23 Apr 2009, 04:03 PM
Hello Jeff,

Thank you for reporting this scenario too. I logged it for fixing and added additional Telerik points to your account for your assistance.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Addams
Top achievements
Rank 1
answered on 04 May 2009, 08:54 PM
I'm using the latest hotfix and with the latest version of Chrome it wraps text in div's.  If I perform steps 1-3 that Jeff described I end up with 2 lines surrounded by div's and a third line that has a "br" surrounded by a div.  Is this a known issue?
0
Rumen
Telerik team
answered on 11 May 2009, 12:26 PM
Hi everyone,

We have completed a new implementation for the NewLineBr = false mechanism for FireFox, which addresses the reported problems of the existing mechanism. The implementation will be a part of the next RadControls Service Pack to be released in a couple of weeks from now. You can also preview the functionality by grabbing the next public Internal Build of RadControls.

Sincerely,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Rod
Top achievements
Rank 1
Answers by
Rod
Top achievements
Rank 1
Rumen
Telerik team
Jeff
Top achievements
Rank 1
Addams
Top achievements
Rank 1
Share this question
or