CuteEditor 6.3 problem with pasting Word HTML - not removing font styles

Last post 05-20-2009, 6:26 AM by Tony43. 8 replies.
Sort Posts: Previous Next
  •  05-03-2009, 2:21 PM 51771

    CuteEditor 6.3 problem with pasting Word HTML - not removing font styles

    HI ,
     
    i´m using cute editor version 6.3.0.0 which works fine.
     
    But I´ve a problem with pasting word HTML (Office 2007) into the cute editor.
     
    I use: CE1.EditorOnPaste = CuteEditor.PasteBehavior.ConfirmWord
     
    In the pasted HTML the unneccessary Word HTML is removed, but the font styles are still existing
    - like in this example this is the result after pasting from word with ConfirmWord = OK:
     
    <h1><span>1<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span>My header</h1>
    <p style="line-height: 120%"><span style="line-height: 120%; font-family: 'Segoe UI','sans-serif'; font-size: 10pt">This is my text...</span></p>
    <p>&nbsp;</p>
     
    I expect that all font styles are also removed, like it was in CE version 5.3!
     
    Is this a bug?
     
    Please help - I can´t use CE with that behavior!
    I need that the font tags are also removed, but e.g. tables and simple HTML tags shall stay (like in 5.3).
     
    Thanks for your help!
    Tony
     
  •  05-04-2009, 2:16 AM 51772 in reply to 51771

    Re: CuteEditor 6.3 problem with pasting Word HTML - not removing font styles

    Tony,
     
    Please check the following example and find the correct option for your situation:
     
     
    The above style tags are valid. So Cute Editor will keep them even they are from MS Word.

    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

  •  05-04-2009, 7:28 AM 51779 in reply to 51772

    Re: CuteEditor 6.3 problem with pasting Word HTML - not removing font styles

    Hi Adam,
     
    thanks for your info.
     
    I tried my Word pasting with the online-demo.
     
    Well, I didn´t find a satisfying solution with the reformatting-behavior.
     
    When pasting formatted text from Word 2007, I want to get "clean" HTML, where:
    • <table>, <tr>, <td> shall stay, so that tables are still viewable and not destroyed
    • simple HTML-Tags like <a> or <b> or <h1> shall stay (be transferred)

    but

    • <span>, <font>, <style> etc. shall be cleaned !
     
    In my example when using PasteWord or ConfirmWord, the font tags stay, like:
     
    <p><strong><span style="font-family: 'Calibri','sans-serif'; font-size: 20pt">My Word Paste Demo</span></strong></p>
    <p><span style="font-family: 'Calibri','sans-serif'">Thank you for choosing <strong>CuteEditor ...
     
    So not desired.
     
    When using PasteCleanHTML:
     
    <p><strong>My Word Paste Demo
    <p>&nbsp;</p>

    This is ok, but the table is still formatted:
     
    <table style="border-bottom: medium none; border-left: medium none; border-collapse: collapse; border-top: medium none; border-right: medium none" class="HelleListe-Akzent1" border="1" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td style="border-bottom: #f0f0f0; border-left: #4f81bd 1pt solid; padding-bottom: 0cm; padding-left: 5.4pt; width: 153.5pt; padding-right: 5.4pt;background: #4f81bd; border-top: #4f81bd 1pt solid; border-right: #f0f0f0; padding-top: 0cm" valign="top" width="205">
                <p style="line-height: normal"><strong>Header A
                <p>&nbsp;</p>
                </strong>
                <p>&nbsp;</p>
                </td>
                <td
    style="border-bottom: #f0f0f0; border-left: #f0f0f0; padding-bottom: 0cm; padding-left: 5.4pt;
                ...etc...

    So PasteCleanHTML seems to deliver the best result for me, but the table with the formats is not useable.
     
    Do you have any idea how to get my desired result?
     
    Thanks!
    Tony
     
  •  05-04-2009, 1:36 PM 51797 in reply to 51779

    Re: CuteEditor 6.3 problem with pasting Word HTML - not removing font styles

    Tony43:
     
    In my example when using PasteWord or ConfirmWord, the font tags stay, like:
     
    <p><strong><span style="font-family: 'Calibri','sans-serif'; font-size: 20pt">My Word Paste Demo</span></strong></p>
    <p><span style="font-family: 'Calibri','sans-serif'">Thank you for choosing <strong>CuteEditor ...
     
    So not desired.
     
     
     
    Tony,
     
    The above code is valid HTML code. We don't think we should remove it.
     
    I suggest you create your own HTML filter to remove the above code.
     

    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

  •  05-08-2009, 5:58 AM 51957 in reply to 51797

    Re: CuteEditor 6.3 problem with pasting Word HTML - not removing font styles

    We've just come across exactly the same issue, where the change in behaviour has confused all our editors and resulted in lots of font style html going into our CMS when we didn't want them.
     
    We need an approach that allows 1 click, or one Ctrl-V action to remove all of the following:
     
    1. Dodgy Word specific tags
    2. Span tags
    3. Font tags
    4. Style attributes
     
    This is basically a combination of the useful behaviour from the Old paste from Word option (removing spans, font tags etc.), with the useful behaviour from the New paste from Word option (removing extra dodgy Word tags which were not removed before)!
     
    Tony, did you manage to create a HTML filter to do what you need, which we might be able to use to solve our headache?
     
    Thanks,
    Dave
     

  •  05-08-2009, 6:19 AM 51958 in reply to 51797

    Re: CuteEditor 6.3 problem with pasting Word HTML - not removing font styles

    Hi Adam,
     
    thanks or your reply.
     
    Yes, I know that the formattings are valid HTML
     
    - but I also know, that version 5.x (I think definitly 5.3)  did remove  these font and style-Tags!
     
    Creating my own HTML Filter is an option - but my latest one; cutesoft seemed to change this paste-behavior and so my wish is to get the "old" function again; maybe as additional Paste-Enumeration?
     
    This would be great!
     
    Thanks,
    Tony
  •  05-08-2009, 6:22 AM 51959 in reply to 51957

    Re: CuteEditor 6.3 problem with pasting Word HTML - not removing font styles

    Hi Dave,

    davidj:
    We've just come across exactly the same issue...
    Tony, did you manage to create a HTML filter to do what you need, which we might be able to use to solve our headache?
    Dave 
     
    no, I didn´t start with the implementation yet - I still hope cutesoft will find or simply add a function to get the "old behavior"...
     
    Anyway, I hope Adam can help!
     
    CU, Tony
  •  05-08-2009, 7:42 AM 51962 in reply to 51959

    Re: CuteEditor 6.3 problem with pasting Word HTML - not removing font styles

    Thanks Tony,
     
    If it helps, it looks as if on the current version of the editor (as found at http://cutesoft.net/example/general.asp), the Paste from Word button exhibits the new behaviour, but the "Clean up HTML" -> "Remove all word specific markup" action still exhibits the old.
     
    As far as I can see, all the functions required to get fairly clean code out of Word are present: New Paste from Word, followed by "Clean up cascading style sheets", then "Clean up <Span> tags".
     
    What we really need is a Button and Ctrl-V preset which will do all of these actions at once, without requiring users to jump through hoops. Perhaps an option could be added to control how Paste from Word works - either "Cautious" mode, which leaves all valid HTML in place, or "Aggressive" mode, which also performs a cascading style sheets cleanup, font tag cleanup and span tag cleanup afterwards.
     
    If you're copying in from a Word document, then the chances that you actually want all the extra <span>s and style stuff that Word adds are pretty low, so I imagine the Aggresive style clean would be far more useful.
     
    Dave
     
     

  •  05-20-2009, 6:26 AM 52351 in reply to 51962

    Re: CuteEditor 6.3 problem with pasting Word HTML - not removing font styles

    Hi Dave,

    davidj:
    ...but the "Clean up HTML" -> "Remove all word specific markup" action still exhibits the old.
    ...What we really need is a Button and Ctrl-V preset which will do all of these actions at once, without requiring users to jump through hoops... 
     
    That´s exactly what would make sense!
     
    The user presses CTRL+V and CuteEditor "Aggressive" mode pastes the HTML content and removes all unessential Word-stuff and formats.
     
    ...cutesoft-team please help!!
     
    Thanks,
    Tony
View as RSS news feed in XML