Wrong <SCRIPT/> tag formatting

  •  11-20-2011, 10:15 AM

    Wrong <SCRIPT/> tag formatting

    Hi,
     
    I have CuteEditor for .Net version 6.6. Browser - IE8. EnableStripScriptTags property is set to false. In the editor I create a simple HTML page with the following code:
     
    <HTML>
        <HEAD>
          <SCRIPT>
             function test() // simply a test function
             { alert("Hello!");
             }
          </SCRIPT>
        </HEAD>
        <BODY onload="test()">
        </BODY>
    </HTML>
     
    After calling getHTML() I'm getting the HTML code correctly. But when I call setHTML() with the same code, I get the following wrongly formatted HTML in the editor:
     
    <HTML>
        <HEAD>
            <SCRIPT>         function test() // simply a test function         { alert("Hello!");         }      </SCRIPT>
        </HEAD>
        <BODY onload=test()>
        </BODY>
    </HTML>
     
    As you can see CuteEditor removes new lines from the code inside <SCRIPT/> tag, as the result the JavaScript code is distorted.
     
    Can you please help me with this issue?
     
    Filed under:
View Complete Thread