Problem using PasteHTML to paste a comment (<!-- xx -->) into editor

Last post 12-07-2007, 8:58 AM by nickp. 4 replies.
Sort Posts: Previous Next
  •  11-29-2007, 6:11 AM 35506

    Problem using PasteHTML to paste a comment (<!-- xx -->) into editor

    It is necessary for me to place HTML comments <!-- XX --> into the cutesoft editor. In order to do so I have attempted to follow the examples as set out on the cutesoft website for entering custom text into a dialog (in order to fill the text inside the comment tags) and using the PasteHTML function to paste it into the editor at the location of the cursor. In order not to lose the cursor location, I have made use of a custom toolbar button which opens the dialog in which a user can add the text.
     
    On insert however, the comment does not appear at the cursor location. When used, it is placed at the beginning of the text, or even stripped completely when using different paste configuration options. When I use the code view property to add the custom button to the toolbar in the code view (in order to paste HTML into an HTML view) I cannot see any effect whatsoever in the editor when I try to add a comment.
     
    Has anyone else worked with trying to enter <!-- XX --> comments into the editor? I have seen several posts about paste problems where text was located in the start of the text after pasting but none of these seem to apply to the situation at hand (and the code is similar). 

  •  11-29-2007, 9:44 AM 35511 in reply to 35506

    Re: Problem using PasteHTML to paste a comment (<!-- xx -->) into editor

    To add a way of reproducing it which will show what I mean, do the following (in a C# project which contains a Cute Editor control inside of an ASPX page):
     
    1. Go to http://cutesoft.net/developer+guide/add_your_own_custom_button.htm
    2. Take the C# code from the second example and paste it into the page_load of the code behind. This should now provide the button in the toolbar (after minor adjustments to rename the editor variable to the name used in the ASPX page).
    3. Replace  '<h2>Hello World</h2>' with 'test'.
    4. compile and run. Toolbar button appears.
    5. Type random text into the editor. Click on the middle of the typed text to place cursor in middle of text and press toolbar button. The word 'test' should now appear in the middle of the text.
     
    Now, go to the codebehind, change the 'test' line in the ExecCommand call to '<!--test-->' and recompile. Type a line of text, click on the middle of the text and press the button. Change to code view. Inserted comment appears at start of typed text, not in the middle.

    - Is this expected behavior? 
    - Is there a way to program around it in order to place the comment in whatever place the cursor is in instead of the beginning of the line?
  •  11-29-2007, 12:08 PM 35525 in reply to 35506

    Re: Problem using PasteHTML to paste a comment (<!-- xx -->) into editor

    Hi
     
    We have work on this issue and found that is IE's bug.
    IE remove the comment if the comment is at the beginning of an element.
     
    Now we still working on this issue to prevent IE from doing that .
     
    Regards , Terry .
  •  11-30-2007, 3:05 AM 35553 in reply to 35525

    Re: Problem using PasteHTML to paste a comment (<!-- xx -->) into editor

    I should add that the problem I am experiencing is occurring in Firefox as well.
  •  12-07-2007, 8:58 AM 35725 in reply to 35525

    Re: Problem using PasteHTML to paste a comment (<!-- xx -->) into editor

    Hi Terry
     
    This is also causing me problems. It is not specifically an IE bug as the company that I am working for primarily use Cute Editor for .NET with Firefox as the client. As this is not browser specific it looks more like a bug with Cute Editor to me, possibly because focus is being lost for some reason.
     
    Is there any estimated time for a fix for this issue? It is causing a bug on an intranet site that I am responsible for giving frequent updates on.
     
    Many thanks,
     
    Nick

View as RSS news feed in XML