Inserting Link Around Image in List Breaks Markup (Firefox Bug)

2 posts, 0 answers
  1. mattzilla
    mattzilla avatar
    29 posts
    Member since:
    Sep 2006

    Posted 21 Jan 2009 Link to this post

    I've discovered that when inserting a link around an image in a list, the linked image will be removed from the <li> and placed just before the closing </ul> or </ol>.

    This occurs in both Firefox and 3.0.5.

    Here's the steps to reproduce:

    1. Open an editor in HTML mode (the demo one is fine:
    2. Paste in the following code:
          <li><img src="" alt="Izilla Logo" /></li
          <li><img src="" alt="Cognition ECM Logo" /></li
    3. Switch to design view
    4. Using the Link Manager, add a link around one of the images.

    You'll end up with something like this:
        <li><img alt="Cognition ECM Logo" src="" /></li
        <href=""><img alt="Izilla Logo" src="" /></a></ul> 


  2. Tervel
    Tervel avatar
    1337 posts

    Posted 27 Jan 2009 Link to this post

    Hello mattzilla,

    Thank you reporting the problem. We were able to verify it. It happens because of the fact that the IMG tags are children of a LI tag. The problem has been fixed in our internal version, and the next Telerik.Web.UI update will work OK.

    We were able to develop a workaround for the time being until the update comes out. Here it is:

                <telerik:radeditor runat="server" ID="RadEditor1"  OnClientPasteHtml="OnClientPasteHtml"/>                                 
    function OnClientPasteHtml(editor, args) 
        var sel = editor.getSelectedElement();     
        if (sel.tagName == "LI" || sel.parentNode.tagName == "LI"

    I hope this helps.

    Best wishes,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top