CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

Last post 07-22-2007, 1:20 PM by kalp_aim. 17 replies.
Sort Posts: Previous Next
  •  12-27-2005, 4:37 PM 14184

    CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    I tried using these two functions, and both removed not only extraneous html, but also required html.  The former removed styling applied from using styles in the Paragraph style dropdown (I have customized the items in the dropdown).  the later removed the opening <table> and <tbody> tags from tables inserted via the table button on the tool bar (it left the closing tags, though).

    Bad news.
  •  12-29-2005, 10:08 PM 14259 in reply to 14184

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    shland,
     
    Can you post a piece of HTML code which can reproduce the problems?
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-03-2006, 7:55 PM 14379 in reply to 14259

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    This was not in the html code of the page... I was calling these in the .NET codebehind.   editor.CleanUpHtmlCode().  What it left behind in the editor.Text property is where the missing HTML was.  Just use your editor to put in some text, maybe a table or two, call these functions, and view the remaining HTML in the Text property.  You'll see it.
  •  01-03-2006, 8:13 PM 14380 in reply to 14379

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    All right, getting tired of having to test your software for you and show you all the errors... but here's an example:

    My user entered stuff and hit the "save" button in our application.  Upon postback, the Editor.Text property contained the following:

    "<span style=\"FONT-WEIGHT: bold; FONT-SIZE: 14pt; MARGIN-BOTTOM: 6pt; FONT-FAMILY: Arial\">Here is Section Heading</span><br></span><br>Here is section text<br><br><span style=\"FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN-BOTTOM: 3pt; FONT-FAMILY: Arial\">And a sub section</span></span><br></span><br><br></span>"

    then before saving to the database, we might want to call Editor.CleanUpMicrosoftWordHTML()... so I did, and afterward this call, the Editor.Text property contains this:

    "Here is Section Heading<br></span><br>Here is section text<br><br>And a sub section</span><br></span><br><br></span>"

    Note that beginning span tags and normal style attributes have been removed.  Why?  This function should only remove the icky Word HTML, not necessary html.

    And the results are not at all what the user created.
  •  01-03-2006, 8:17 PM 14381 in reply to 14380

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    And, for one more example, if instead I call Editor.CleanUpHTMLCode() after my user hits "save", the Editor.Text property goes from this:

    "<span style=\"FONT-WEIGHT: bold; FONT-SIZE: 14pt; MARGIN-BOTTOM: 6pt; FONT-FAMILY: Arial\">Here is Section Heading</span><br></span><br>Here is section text<br><br><span style=\"FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN-BOTTOM: 3pt; FONT-FAMILY: Arial\">And a sub section</span></span><br></span><br><br></span>"

    to this:
    "Here is Section Heading<br><br>Here is section text<br><br>And a sub section<br><br><br>"

    I thought this call was to clean up extraneous html, extra tags, etc, not to remove *all* formatting!




  •  01-03-2006, 9:08 PM 14383 in reply to 14380

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

     
    I'm seeing something very similar to this myself.  I'm evaluating the Editor component, and I put in:
     
    "<div><span style="FONT-FAMILY: Arial">This is <strong>test content</strong> for 007 ... <img height=55 src="/image/portal.gif" width=240></span></div>"
     
    When I call my save routine, what remains in the Editor.Text property is:
     
    "<div><span style="FONT-FAMILY: Arial">Th "

    When my code recalls this truncated snippet from the database and loads it back into the Editor, using the .Text property, the Editor closes the div and span tags, but all the original content following "Th" (e.g. "This is test content ... ") is lost.

    Is the eval license crippled to 40 plain text (non-HTML) characters?  Is the CleanUpHTML method being called automatically?  What's going on?

    I'm ready to buy the Enterprise license, but I need to resolve this immediately or find another editor.  Thanks for your help!
     
     
    Doug
     
  •  01-03-2006, 9:16 PM 14384 in reply to 14383

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    Doug,

    CleanUpHTML method is not being called automatically.

    I tried your HTML code in the following example:

    http://cutesoft.net/example/general.aspx

    I don't have any problems.

    Can you test it again?

    Keep me posted


     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-03-2006, 9:36 PM 14385 in reply to 14384

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    And, what about the examples I posted?  
  •  01-03-2006, 9:38 PM 14386 in reply to 14381

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    shland,
     
    I've created an online example to test the Editor.CleanUpHTMLCode().
     
     
    I can reproduce the problems you mentioned.
     
    We are investigating this issue and will get back to you as soon as possible.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-03-2006, 11:48 PM 14388 in reply to 14384

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    It works in your online example, but I'm testing the .Text property using the Visual Studio debugger immediately upon clicking submit here (in my local code), and the content I entered is definitely being truncated by the Editor control before my code even has a chance to do anything with it.
     
    Is it possible that the freely downloadable trial version is crippled at 40 characters of output?  I'd be happy to buy control.  In fact, I'm desperate for it, but I need to know that it will work once purchased.  Thanks!
     
     
    Doug
     
  •  01-04-2006, 1:44 AM 14389 in reply to 14388

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    Doug,
     
    Please test the following link:
     

    In this example, I passted the string you mentioned using the .Text property.
     
    The code of this example is as followings:
     
     
     <%@ Page Language="C#" ValidateRequest="false" %>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <script runat="server">
     void Page_Load(object sender, System.EventArgs e)
      {
         if (IsPostBack)
      {
       textbox1.Text = Editor1.Text;
         }
      else
      {
       Editor1.Text = @"<div><span style=""FONT-FAMILY: Arial"">This is <strong>test content</strong> for 007 ... <img height=55 src=""/image/portal.gif"" width=240></span></div>";
      }
     
     }
     public void Submit(object sender, System.EventArgs e)
     {
       textbox1.Text = Editor1.Text;
       Editor1.CleanUpHTMLCode();
       textbox2.Text = Editor1.Text;
     }
    </script>
    <html>
     <head>
     </head>
     <body>
            <form runat="server">
       <CE:Editor AllowEditServerSideCode="true" id="Editor1" runat="server" ></CE:Editor><BR>
       <br />
       <asp:Button id="btnUpdate" onclick="Submit" Runat="server" CssClass="button65" Text="Submit"></asp:Button>      
       <br />
       <asp:textbox id="textbox1" runat="server" TextMode="MultiLine" Height="250px" Width="730px" Font-Name="Arial"></asp:TextBox><br />  
       <br />
       Use CleanUpHTMLCode Method: <br>
       <asp:textbox id="textbox2" runat="server" TextMode="MultiLine" Height="250px" Width="730px" Font-Name="Arial"></asp:TextBox><br />  
       
        
      </form>
     </body>
     
     
    >>Is it possible that the freely downloadable trial version is crippled at 40 characters of output? 

    No.

    Keep me posted

     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-04-2006, 4:08 AM 14391 in reply to 14389

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    First, I'd like to thank you for hanging with me so late into the night.  I greatly appreciate your efforts!
     
    I tried your online example successfully, and the only difference I noted between your code and mine was the AllowEditServerSideCode="true" setting.  I had mine set to "false", so I changed it to "true", but it had no effect on the truncation.
     
    I'd like to try to replace my license (lic) file either by purchasing the product or with a temporary license/key generated for test purposes only.  In the morning, who can I contact about this, and what time zone is CuteSoft in?

    Thanks again for all your help!

     
    Doug
     
  •  01-04-2006, 1:59 PM 14421 in reply to 14391

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    Doug,
     
    >>the only difference I noted between your code and mine was the AllowEditServerSideCode="true" setting
     
    It should not have any effect to our testing.
     
    >>what time zone is CuteSoft in?

    We are in Ontario, Canada. Eastern time.

    >>In the morning, who can I contact about this

    Please write to karen@cutesoft.net for the purchase issues.

    Keep me posted





    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  02-11-2006, 4:37 PM 15846 in reply to 14388

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    Guys,
     
    CleanUpHTMLCode and CleanUpMicrosoftWordHTML issues have been fixed in the build (02/09/2006).
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-17-2007, 12:53 PM 31625 in reply to 15846

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    Hello.
    I use 5.3.0.0 CuteEditor 5.3 Build 2006-08-18
    About function CleanUpMicrosoftWordHTML().
    In Reference Book I read the following:
    CleanUpMicrosoftWordHTML() - Use the Clean Up Word HTML function to remove the extraneous HTML code generated by Microsoft Word.
    But after invoking CleanUpMicrosoftWordHTML() , I have same problem that shland:
    This function does not remove only Word HTML...
    -----------------------------------
    "<span style=\"FONT-WEIGHT: bold; FONT-SIZE: 14pt; MARGIN-BOTTOM: 6pt; FONT-FAMILY: Arial\">Here is Section Heading</span><br></span><br>Here is section text<br><br><span style=\"FONT-WEIGHT: bold; FONT-SIZE: 12pt; MARGIN-BOTTOM: 3pt; FONT-FAMILY: Arial\">And a sub section</span></span><br></span><br><br></span>"

    then before saving to the database, we might want to call Editor.CleanUpMicrosoftWordHTML()... so I did, and afterward this call, the Editor.Text property contains this:

    "Here is Section Heading<br></span><br>Here is section text<br><br>And a sub section</span><br></span><br><br></span>"
    -----------------------------------
    Is this problem resolved ?
    Also what functions on the Client Side have I for cleaning Word HTML ?
     
    Thanks

     
  •  07-18-2007, 10:09 AM 31658 in reply to 31625

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    Hi.
    I updated to current version 6.0.0.0 , CuteEditor 6.0 Build 2007-07-17.
    TEST 1:
    WORD NTML
    ------------------------
    Editor1.Text property contains :
    "<div><span>&nbsp;\r\n<p class=\"MsoNormal\" style=\"margin-left: 17.85pt\"><span lang=\"EN-US\" style=\"color: green\">Test Text<strong style=\"mso-bidi-font-weight: normal\"> <em style=\"mso-bidi-font-style: normal\">Test</em> Text <o:p></o:p></strong></span></p>\r\n<p class=\"MsoNormal\" style=\"margin-left: 17.85pt\"><strong style=\"mso-bidi-font-weight: normal\"><u><span lang=\"EN-US\" style=\"color: green\">Test Text <o:p></o:p></span></u></strong></p>\r\n<p class=\"MsoNormal\" style=\"margin-left: 17.85pt\"><strong style=\"mso-bidi-font-weight: normal\"><span lang=\"EN-US\" style=\"color: green; font-family: Arial\">Test Text <o:p></o:p></span></strong></p>\r\n<p class=\"MsoNormal\" style=\"margin-left: 17.85pt\"><strong style=\"mso-bidi-font-weight: normal\"><span lang=\"EN-US\" style=\"font-size: 10pt; color: green\">Test Text <o:p></o:p></span></strong></p>\r\n</span></div>\r\n";
    Editor1.CleanUpMicrosoftWordHTML();
    Editor1.Text property contains :
    "\r\n  <div>\r\n    <span> \r\n<p  ><span >Test Text<strong ><em >Test</em> Text </strong></span></p><p  ><strong ><u><span >Test Text </span></u></strong></p><p  ><strong ><span >Test Text </span></strong></p><p  ><strong ><span >Test Text </span></strong></p></span>\r\n  </div>\r\n";
    -----------------
    TEST 2:
    NORMAL HTML
    ------------------------
    Editor1.Text property contains :
    "<div><span style=\"color: red\">Test text&nbsp; </span>\r\n<div><span style=\"font-size: 10pt\">Test text</span> </div>\r\n<div><strong>Test text</strong> </div>\r\n<div><span style=\"font-family: Arial\">Test text</span> </div>\r\n</div>\r\n";
    Editor1.CleanUpMicrosoftWordHTML();
    Editor1.Text property contains :
    "\r\n  <div>\r\n    <span >Test text  </span>\r\n    <div>\r\n      <span >Test text</span>\r\n    </div>\r\n    <div>\r\n      <strong>Test text</strong>\r\n    </div>\r\n    <div>\r\n      <span >Test text</span>\r\n    </div>\r\n  </div>\r\n";
    -----------------
    Is it normal ? Why "style" has been deleted ? 
    I repeat question:
    What functions on the Client Side have I for cleaning Word HTML ?
     
  •  07-19-2007, 3:01 AM 31689 in reply to 31658

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    >>Is it normal ? Why "style" has been deleted ? 
     
    We are investigating this issue and get back to you as soon as possible.
     
    >>What functions on the Client Side have I for cleaning Word HTML ?
     
    In the bottom of your page, add the following code and put your own filter logic there.
    <script>
       function CuteEditor_FilterCode(editor,code)
       {
          // clean code here
          return code;
       }
    </script>
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-22-2007, 1:20 PM 31758 in reply to 14184

    Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

    hi
    i am kalpesh
    i am new in this programming fiedl ,,, i want to start Asp.net to learn
    would you please help me.......?
    what sort of thing i should take care and should prepare?
View as RSS news feed in XML