Skip to content

Commit

Permalink
Merge branch 't/10854' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Oct 25, 2013
2 parents 4986e13 + 39621ea commit 2d9c3ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -32,6 +32,7 @@ Fixed Issues:
* [#10877](http://dev.ckeditor.com/ticket/10877): Fixed: WebSpellChecker fails to apply changes if nested editable was focused.
* [#10870](http://dev.ckeditor.com/ticket/10870): Fixed: `paste` command is not being disabled when clipboard is empty any more.
* [#10866](http://dev.ckeditor.com/ticket/10866): Fixed: Broken *Tab* key navigation in the Image2 dialog.
* [#10854](http://dev.ckeditor.com/ticket/10854): Fixed: Firefox prepends `<br>` to `<body>`, so it is stripped by the HTML data processor.

## CKEditor 4.3 Beta

Expand Down
11 changes: 10 additions & 1 deletion core/htmldataprocessor.js
Expand Up @@ -143,8 +143,17 @@


editor.on( 'toDataFormat', function( evt ) {
var data = evt.data.dataValue;

// #10854 - we need to strip leading blockless <br> which FF adds
// automatically when editable contains only non-editable content.
// We do that for every browser (so it's a constant behavior) and
// not in BR mode, in which chance of valid leading blockless <br> is higher.
if ( evt.data.enterMode != CKEDITOR.ENTER_BR )
data = data.replace( /^<br *\/?>/i, '' );

evt.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(
evt.data.dataValue, evt.data.context, getFixBodyTag( evt.data.enterMode, editor.config.autoParagraph ) );
data, evt.data.context, getFixBodyTag( evt.data.enterMode, editor.config.autoParagraph ) );
}, null, null, 5 );

editor.on( 'toDataFormat', function( evt ) {
Expand Down

0 comments on commit 2d9c3ff

Please sign in to comment.