Make WordPress Core

Ticket #29571: 29571.2.patch

File 29571.2.patch, 630 bytes (added by JoshuaGoodwin, 10 years ago)

A patch for qt.TagButton (with the correct index, sorry)

  • wp-includes/js/quicktags.js

     
    491491                                        canvas.value = l + i + t.tagStart + r; // insert self closing tags after the selection
    492492                                        cursorPos += t.tagStart.length;
    493493                                } else {
     494                                        if ( i.charAt(i.length - 1) === '\n' ) { // WebKit
     495                                                i = i.substring(0, i.length - 1);
     496                                                r = '\n' + r;
     497                                                cursorPos -= 1;
     498                                        }
    494499                                        canvas.value = l + t.tagStart + i + endTag + r;
    495500                                        cursorPos += t.tagStart.length + endTag.length;
    496501                                }