Last Updated: 21 Jul 2015 18:32 by Lenny_shp
Marin Bratanov
Created on: 19 Jul 2013 15:15
Category: Editor
Type: Feature Request
POLL: The default value of the NewLineMode property in RadEditor should be P
In Q2 2013 the block commands in RadEditor were greatly improved to match desktop editors closely. This means that now block elements like <p> or <div> are required for operations like creating lists, indent/outdent commands.

The default value for the NewLineMode property of the control is BR for historical reasons and thus when the end users press enter they do no longer create elements the block commands can work with. Changing it would be a breaking change, however.
Here is a list with possible implications of changing the default NewLineMode value to P:

- The default text editing in modern browsers according to HTML5 specifications ( requires that a paragraph is inserted when enter is pressed
- The content generated by the end users by default will integrate better with the improved commands of the control
- Most desktop rich text editing applications (like MS Word) insert a paragraph when enter is pressed

- A breaking change in the current control behavior and configuration
- When paragraphs are inserted they will add more margins so the final appearance of the content and the editing process will require more height
- By default, the underlying rich-text editing engine of Firefox uses BR tags and Chrome's - DIV tags

Please use the buttons on the right to vote whether this change should be implemented. If you have anything to add - the comments below can be used.
Posted on: 21 Jul 2015 18:32
You should have kept the default to "Br" and let the people who needs "P" to change the code.   I had to search for a solution for the "P" after upgrading to new control version.
Don Leduc
Posted on: 14 Apr 2014 13:58
With any functionality, if it doesn't behave like the way users expected it, then you know you must change it.
Posted on: 21 Mar 2014 14:33
I think it is fine as long as developers who still need it to be DIV or BR can set the property appropriately and have the exact same functionality they had before.
Posted on: 19 Mar 2014 08:47
Hi John,

Indeed, the only change will be the value of the NewLineMode property, which will be set to "P" by default. The users, who do not like this behavior, will be able to switch the value to "Br" or "Div" without problems.

Best regards,
Posted on: 18 Mar 2014 13:18
My understanding is that the only change is to the default value of NewLineMode. Explicitly stating BR for this mode (the previous default) would be the only requirement for the Editor content to appear as before, but, by default, the Editor would more closely match MS Word.

If the above is correct, go for it,
Posted on: 14 Mar 2014 09:33
@Alisa, The NewLineMode currently supports using P, BR and DIV elements as possible options, so you could reconfigure the RadEditor control with one of the options. Furthermore these options will not be removed in feature releases of the Telerik control. 

Also, the BR and the P elements could be used by the user via keyboard shortcut Shift+Enter and Ctrl+Enter. More about this matter can be examined by following this link:

@LePaul, The extra height of the P element comes due to the default browser stylization (user agent stylesheet). You can additionally set custom CSS rules to reset or define different stylization. Please follow this online example, in which is explained this matter more thoroughly.
Posted on: 29 Jan 2014 12:50
The extra height added by a <p> is idd. a huge drawback. Your document start to looks like a child book. Unfortunately you need the <p> for a bullet list, indent, undent etc.
Posted on: 18 Dec 2013 14:15
As I was working on implementing crutches because of different work (in IE and not IE) of br-tag with our custom div-control in rad editor - I support! Br tag is outdated. Maybe we should also think about implementing of not P, but DIV (or switching between P and DIV) that could have no margin in the top and bottom then it will look the same for end-user.
Posted on: 24 Nov 2013 14:22
I think this should be done and I support it. Moving RadEditor closer to the desktop (esp MS Word) behavior - or standards recommendations in general - is a positive in my book.
Marin Bratanov
Posted on: 11 Nov 2013 07:35
Thank you for sharing your experience.
I would only like to add the the property you should use is NewLineMode, NewLineBr is deprecated because it does not offer all the options RadEditor has (br, p, div).
Posted on: 09 Nov 2013 09:44
Generally I recognize two possible scenarios:
1) when I want to enable the user to input advanced HTML formatting (e.g. writting an article), I disable NewLineBr mode to make the user able to insert P after pressing an enter. Besides, I highlight paragraphes by setting in CSS to have dotted border so user can see what paragraphes he has
2) when simple HTML is entered, I enable NewLineBr mode (e.g. when writting a comment, I dont want the user to write paragraphes).
Marin Bratanov
Posted on: 08 Nov 2013 10:54

You can create a content filter that will add a custom class to all your paragraphs:

To capture a keypress you can attach a handler to the content area and look for a certain keycode:
Karl Maynard
Posted on: 08 Nov 2013 10:08
The answer to this issue is very much related to the content being edited, if you are using the editor to edit web pages/content, then divs (and br ?) would probably be the best option.

We use the editor for creating emails in an on-line customer service system - almost every single user is used to using MS Word, and come from using Outlook.

From my point of view, having the commands work as they do in MS Word (ENTER=P / SHIFT-ENTER=BR) and then using stylesheets or an inline style to sort out the spacing issues. 

Having the ability to add a class name to paragraphs inserted by the editor would also be nice, and for those who really want lots of control, how about raising an event OnEnter or OnShiftEnter ?
Marin Bratanov
Posted on: 04 Nov 2013 12:56
Hi guys,
Straight to each point:

@Celeste: Paragraphs in HTML have padding by default. You can change this via CSS in your own site where the content is going to be used, and in the content area of the editor: .
Paragraph styles are already available as well: .

@David: Yes, we are aware of the shift+enter and ctrl+enter combinations and we are taking them in to account. Using shift+enter when NewLineMode=P will insert a line break (just like in MS Word) and ctrl+enter when NewLineMode=BR will insert paragraphs. This is also explained here: .

I hope this answers your questions. I would also like to remind that you can change your votes, should this information change your mind.

Posted on: 04 Nov 2013 12:06
In most desktop environment editors, it is possible to implicitely choose between a new line and a new paragraph... If moving toward P, I can adhere to it if there is a way to choose between a new line or paragraph (MSWord mentionned above have Enter or Shift-Enter behavior implemented). Would be great then.
Posted on: 30 Oct 2013 17:09
<p> tags insert a blank line which is really not a traditional paragraph  which has no extra line and the first line is indented (just open a novel and look at it)! So using <p> has always been a real problem ever since html was invented. I suggest that you extend your editor to allow the user to select the paragraph style they want - No Blocking, Block, Modified Block, or Semi-Block and then the return key can select the appropriate tag for the style.