|
278 | 278 |
|
279 | 279 | // Filter all children, skip root (fragment or editable-like wrapper used by data processor).
|
280 | 280 | fragment.forEach( function( el ) {
|
281 |
| - if ( el.type == CKEDITOR.NODE_ELEMENT ) { |
282 |
| - if ( filterFn( el, rules, transformations, toBeRemoved, toHtml ) ) |
283 |
| - isModified = true; |
284 |
| - } |
285 |
| - else if ( el.type == CKEDITOR.NODE_COMMENT && el.value.match( /^\{cke_protected\}(?!\{C\})/ ) ) { |
286 |
| - if ( !filterProtectedElement( el, protectedRegexs, filterFn, rules, transformations, toHtml ) ) |
287 |
| - toBeRemoved.push( el ); |
288 |
| - } |
289 |
| - }, null, true ); |
| 281 | + if ( el.type == CKEDITOR.NODE_ELEMENT ) { |
| 282 | + // (#10260) Don't touch elements like spans with data-cke-* attribute since they're |
| 283 | + // responsible e.g. for placing markers, bookmarks, odds and stuff. |
| 284 | + // We love 'em and we don't wanna lose anything during the filtering. |
| 285 | + // '|' is to avoid tricky joints like data-="foo" + cke-="bar". Yes, they're possible. |
| 286 | + if ( el.name == 'span' && ~CKEDITOR.tools.objectKeys( el.attributes ).join( '|' ).indexOf( 'data-cke-' ) ) |
| 287 | + return; |
| 288 | + |
| 289 | + if ( filterFn( el, rules, transformations, toBeRemoved, toHtml ) ) |
| 290 | + isModified = true; |
| 291 | + } |
| 292 | + else if ( el.type == CKEDITOR.NODE_COMMENT && el.value.match( /^\{cke_protected\}(?!\{C\})/ ) ) { |
| 293 | + if ( !filterProtectedElement( el, protectedRegexs, filterFn, rules, transformations, toHtml ) ) |
| 294 | + toBeRemoved.push( el ); |
| 295 | + } |
| 296 | + }, null, true ); |
290 | 297 |
|
291 | 298 | if ( toBeRemoved.length )
|
292 | 299 | isModified = true;
|
|
0 commit comments