mirror of
git://develop.git.wordpress.org/
synced 2025-02-24 08:33:35 +01:00
TinyMCE: fix removing a space before inline tags when applying formatting shortcuts.
Fixes #35798. git-svn-id: https://develop.svn.wordpress.org/trunk@36513 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
126193fa3c
commit
43dae50c0d
@ -156,13 +156,21 @@
|
||||
refPattern = pattern;
|
||||
}
|
||||
|
||||
function ltrim( text ) {
|
||||
if ( text ) {
|
||||
return text.replace( /^\s+/, '' );
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
function enter() {
|
||||
if ( refNode ) {
|
||||
editor.undoManager.add();
|
||||
|
||||
editor.undoManager.transact( function() {
|
||||
editor.formatter.apply( refPattern.format, {}, refNode );
|
||||
refNode.replaceData( 0, refNode.data.length, tinymce.trim( refNode.data.slice( refPattern.start.length ) ) );
|
||||
refNode.replaceData( 0, refNode.data.length, ltrim( refNode.data.slice( refPattern.start.length ) ) );
|
||||
} );
|
||||
|
||||
// We need to wait for native events to be triggered.
|
||||
|
Loading…
x
Reference in New Issue
Block a user