File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ CKEditor 4 Changelog
12
12
* [ #10315 ] ( http://dev.ckeditor.com/ticket/10315 ) : [ Webkit] Undo manager should not record snapshots after filling char has been added/removed.
13
13
* [ #10320 ] ( http://dev.ckeditor.com/ticket/10320 ) : Justify plugin should add elements to the ACF based on current enter mode.
14
14
* [ #10260 ] ( http://dev.ckeditor.com/ticket/10260 ) : Fixed: Advanced Content Filter blocks tabSpaces. Unified ` data-cke-* ` attributes filtering.
15
+ * [ #10291 ] ( http://dev.ckeditor.com/ticket/10291 ) : [ Webkit] Space after filling char should be secured.
15
16
16
17
## CKEditor 4.1
17
18
Original file line number Diff line number Diff line change 149
149
// We can't simply remove the filling node because the user
150
150
// will actually enlarge it when typing, so we just remove the
151
151
// invisible char from it.
152
- fillingChar . setText ( fillingChar . getText ( ) . replace ( / \u200B / g , '' ) ) ;
152
+ fillingChar . setText ( replaceFillingChar ( fillingChar . getText ( ) ) ) ;
153
153
154
154
// Restore the bookmark.
155
155
if ( bm ) {
162
162
}
163
163
}
164
164
165
+ function replaceFillingChar ( html ) {
166
+ return html . replace ( / \u200B ( ) ? / g, function ( match ) {
167
+ // #10291 if filling char is followed by a space replace it with nbsp.
168
+ return match [ 1 ] ? '\xa0' : '' ;
169
+ } ) ;
170
+ }
171
+
165
172
function isReversedSelection ( sel ) {
166
173
if ( ! sel . isCollapsed ) {
167
174
var range = sel . getRangeAt ( 0 ) ;
489
496
resetSelection = 1 ;
490
497
491
498
fillingCharBefore = fillingChar . getText ( ) ;
492
- fillingChar . setText ( fillingCharBefore . replace ( / \u200B / g , '' ) ) ;
499
+ fillingChar . setText ( replaceFillingChar ( fillingCharBefore ) ) ;
493
500
}
494
501
}
495
502
You can’t perform that action at this time.
0 commit comments