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

\r\n are stirpped by rad editor other HTML tags like <br/> are diplayed as it is when set from code

1 Answer 61 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ramesh
Top achievements
Rank 1
Ramesh asked on 07 Jun 2010, 10:07 PM
when I set the content property of the rad editor with content that has \r\n tags, </br> tags and other html tags,

the \r\n are stripped and the other html tags are displayed as it is in the rad editor.

I set the code like this,

RadEditor1.Content = encodedString;

in the rad grid I get the result as follows,

<pre> <h1>My First Heading</h1> <p>My first paragraph.</p> Dear Dr. <<Contributor's name>>, <br/> On behalf of the Primary Care Department at UpToDate, I would like to thank you for the work that youve done as an author for us. We are very appreciative of your contributions regarding the topic <<Title of topic>>. <br/> This letter follows several attempts we have made to get in touch with you about a very important disclosure request, which is a necessary piece of our editorial process. As you may know, we are accredited to provide CME to our subscribers. In order to maintain this accreditation, we must collect disclosure information from our authors on an annual basis. We have not received a <<previous year>> disclosure form from you, despite our attempts to contact you in this regard. <br/> In keeping with our editorial policy and CME guidelines, we are removing your name from our program as author on the <<Title of topic>> topic, beginning with version <<next version>> (to be released in <<month and year>>). <br/> Again, thank you very much for participating in the UpToDate program. </br> Sincerely, <<EA's name>> </pre>

the <Br/> tags are put as it is... and the there is no new lines generated even though the encoded string contains \r and \n


Can the Rad editor Understand HTML tags and render accordingly?

Thanks,
Ramesh

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 10 Jun 2010, 08:29 AM
Hi Ramesh,

You can render content with < and > symbols in Design mode of RadEditor only if the < and > tag symbols are being encoded to &lt; and &gt; entities in the content. When the content with &lt; and &gt; entities is loaded through the Content property it is a normal behavior to render the tags symbols as < and > in Design mode.

You should not encode the string before loading it in RadEditor.

You can test the following demos for more information:

Save In External File and
Save In Database

The file used in the save in external file demo is a standard HTML file with HTML tags in it.

The /r/n symbols are not rendered in Design mode because they are not part of the HTML specification and the browser could not render them in the editable IFRAME based content area of RadEditor.

All the best,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Ramesh
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or