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

FormatStripper: ALL_NO_BRAKES doubles <br> on Firefox

1 Answer 52 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 21 Apr 2010, 03:17 PM
Just the title suggests, Firefox is turning <br> into two and two into four at each page submit.  IE is fine.  Default Content Filters are applied (or just not set) in this case.  I am linking to a Tools File to add aditional Symbols and only use the Ajax Spellchecker as the tools for the editors.

Both styles of Javascript Event attaching yield the same result

Method 1: using OnClientSubmit="OnClientSubmit" to attach the JS

 

function OnClientSubmit(editor)

 

{

    editor.fire(

"FormatStripper", { value: "ALL_NO_BRAKES" });

 

}


Method 2: using OnClientLoad="OnClientLoad" to attach the JS

 

function OnClientLoad(editor, args)

 

{

    editor.add_submit(

function ()

 

    {

        editor.fire(

"FormatStripper", { value: "ALL_NO_BRAKES" });

 

    });

}

I will be trying an update set of Controls, but the version of Telerik.Web.UI.dll used is 2009.3.1208.20.

1 Answer, 1 is accepted

Sort by
0
Tom
Top achievements
Rank 1
answered on 21 Apr 2010, 05:39 PM
This may be a potential solution.  The newline/carriage return will emit an extra <br /> at the FormatStripper with the value ALL_NO_BRAKES on non IE browsers.  The newline/carriage return may or may not be added depending on browser.  This handles the newline/carriage return on Format Stripping and Load.

Use the following JavaScript on the page.

    function OnClientSubmit(editor)  
    {  
        editor.fire("FormatStripper", { value: "ALL_NO_BRAKES" });  
          
        var contentBlock = editor.get_html(true);  
          
        contentBlock = contentBlock.replace(/\r\n/g, "");  
        contentBlock = contentBlock.replace(/\n/g, "");  
        contentBlock = contentBlock.replace(/\r/g, "");  
          
        editor.set_html(contentBlock);  
    }  
 
    function OnClientLoad(editor, args)  
    {  
        var contentBlock = editor.get_html(true);  
          
        contentBlock = contentBlock.replace(/\r\n/g, "");  
        contentBlock = contentBlock.replace(/\n/g, "");  
        contentBlock = contentBlock.replace(/\r/g, "");  
          
        editor.set_html(contentBlock);  
    } 

Put these attributes on each RadEditor:

OnClientSubmit="OnClientSubmit" OnClientLoad="OnClientLoad" 


Tags
Editor
Asked by
Tom
Top achievements
Rank 1
Answers by
Tom
Top achievements
Rank 1
Share this question
or