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

RadEditor <br /> instead of <p>

1 Answer 56 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 15 Jun 2011, 08:05 AM
Is there a way to make the RadEditor insert <br /> instead of <p> tags when the user presses the Enter key.

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 16 Jun 2011, 02:10 PM
Hello Frank,

Are you using the Silverlight/WPF RadRichTextBox with HtmlFormatProvider? If that is the case, you cannot customize the output in such a way without making any changes in the provider itself or implementing a new format provider.
By default, new paragraphs are created when you hit enter and line breaks when you press Shift+Enter. The new paragraphs are exported with the <p> tag, whereas the line breaks are exported as <br /> inside the paragraph. 
Since the exported HTML conforms to XHTML, you can load the string with XML reader and change the exported document. If you need, we can also send you the source code of the format provider, so that you can adjust the export. However, if you will be loading the exported HTML in RadRichTextBox at a later time, changing the export in this way will not a very good idea, as the whole document will be split in one or two paragraphs and this will cause performance issues.

All the best,
Iva
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
TextBox
Asked by
Alex
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or