Make WordPress Core

Changeset 37661


Ignore:
Timestamp:
06/09/2016 12:24:56 AM (9 years ago)
Author:
azaozz
Message:

Editor quickTags: when the user selects some text by triple-clicking, then wraps it in a tag, and the last selected char is \n, insert the closing tag before the line break.

Props JoshuaGoodwin azaozz.
Fixes #29571.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/quicktags.js

    r32899 r37661  
    527527            startPos = canvas.selectionStart;
    528528            endPos = canvas.selectionEnd;
     529
     530            if ( startPos < endPos && v.charAt( endPos - 1 ) === '\n' ) {
     531                endPos -= 1;
     532            }
     533
    529534            cursorPos = endPos;
    530535            scrollTop = canvas.scrollTop;
Note: See TracChangeset for help on using the changeset viewer.