Re: CleanUpHTMLCode and CleanUpMicrosoftWordHTML buggy

  •  01-03-2006, 8:13 PM

    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.
View Complete Thread