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

RadEditor strips head tag away

2 Answers 45 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Kristopher
Top achievements
Rank 1
Kristopher asked on 11 Jul 2013, 05:08 PM
When inserting an html document from the code behind, if we switch between design mode and html mode, radeditor modifies the html undesirably.  This even happens when content filter is set to none.  If we insert the html by hand (copy paste into html mode, this doesn't happen).  It seems to strip away the inner text of the head tag, and then when switched back to design mode, shows bullet points.  I've attached pictures to show the issue.  We are using cnn.com as a test, and we append the date to the beginning of the text (oddly this text doesn't show up in the html text section).  

http://imgur.com/a/nrtIE

1: First time it is displayed, everything is fine (those spaces are okay)
2: switch to html mode, we see there is nothing between header
3. Switch back to design mode, there are now bullet points?!? (these are not show in the html mode)
4. Copy and paste the html by hand
5. Displays fine (can switch back and forth no problem). 

Any ideas?  

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 12 Jul 2013, 12:02 PM
Hi Kristopher

You can fix this browser problem by overriding the TemplateManager command and manually setting the stripped by the browser HTML, HEAD and BODY tags. Here is an example how to do that:

aspx:
<telerik:radeditor runat="server" ID="RadEditor1" TemplateManager-ViewPaths="~/" TemplateManager-UploadPaths="~/"></telerik:radeditor>
JS:
<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList["TemplateManager"] = function(commandName, editor, args)
{
   var myCallbackFunction = function(sender, args)
   {
       var resultImageObject = args.Result;
       editor.set_Html("<html><head></head><body>" + resultImageObject + "</body></html>")
   }
  editor.showDialog("TemplateManager", {}, myCallbackFunction);
};
</script>

Thanks
Shinu
0
Kristopher
Top achievements
Rank 1
answered on 12 Jul 2013, 03:52 PM
No.  Same results as before: it keeps the formatting of the email but adds these random bullet points. 
Tags
Editor
Asked by
Kristopher
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Kristopher
Top achievements
Rank 1
Share this question
or