Make WordPress Core

Changeset 36513


Ignore:
Timestamp:
02/12/2016 04:22:03 AM (11 years ago)
Author:
azaozz
Message:

TinyMCE: fix removing a space before inline tags when applying formatting shortcuts.

Fixes #35798.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js

    r33622 r36513  
    157157                }
    158158
     159                function ltrim( text ) {
     160                        if ( text ) {
     161                                return text.replace( /^\s+/, '' );
     162                        }
     163
     164                        return '';
     165                }
     166
    159167                function enter() {
    160168                        if ( refNode ) {
    … …  
    163171                                editor.undoManager.transact( function() {
    164172                                        editor.formatter.apply( refPattern.format, {}, refNode );
    165                                         refNode.replaceData( 0, refNode.data.length, tinymce.trim( refNode.data.slice( refPattern.start.length ) ) );
     173                                        refNode.replaceData( 0, refNode.data.length, ltrim( refNode.data.slice( refPattern.start.length ) ) );
    166174                                } );
    167175
Note: See TracChangeset for help on using the changeset viewer.