Ticket #8470: link_anchor_bug.patch

File link_anchor_bug.patch, 1.5 KB (added by yiminghe, 13 years ago)
  • plugin.js

     
    501501                                {
    502502                                        var currentParent = currentNode.getParent();
    503503
     504                    // hack for a
     505                    // 1<a href='http://www.taobao.com'>2</a>3
     506                    // select all ,set link to http://www.ckeditor.com
     507                    // expect => <a href='http://www.ckeditor.com'>123</a> (same with tinymce)
     508                    // but ckeditor now => <a href="http://www.ckeditor.com">1</a>
     509                    // <a href="http://www.taobao.com">2</a>
     510                    // <a href="http://www.ckeditor.com">3</a>
     511                    if (currentParent && elementName == "a" && currentParent.getName() == elementName) {
     512                        var tmpANode = getElement(this, document);
     513                        currentParent.moveChildren(tmpANode);
     514                        currentParent.$.parentNode.replaceChild(tmpANode.$, currentParent.$);
     515                        tmpANode.mergeSiblings();
     516                    }
     517
    504518                                        // Check if the style element can be a child of the current
    505519                                        // node parent or if the element is not defined in the DTD.
    506                                         if ( currentParent
     520                                        else if ( currentParent
    507521                                                && ( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement )
    508522                                                && ( !def.parentRule || def.parentRule( currentParent ) ) )
    509523                                        {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy