RadEditor strips head tag away

3 posts, 0 answers
  1. Kristopher
    Kristopher avatar
    13 posts
    Member since:
    Jul 2013

    Posted 11 Jul 2013 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Jul 2013 Link to this post

    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
  3. Kristopher
    Kristopher avatar
    13 posts
    Member since:
    Jul 2013

    Posted 12 Jul 2013 Link to this post

    No.  Same results as before: it keeps the formatting of the email but adds these random bullet points. 
Back to Top