From ce8aa225fe37b037d098683f0533deb4f8940a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Thu, 24 Oct 2013 14:54:11 +0200 Subject: [PATCH 1/3] Remove leading
when processing data in toDataFormat. --- core/htmldataprocessor.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/htmldataprocessor.js b/core/htmldataprocessor.js index bf0de075228..11ae5a731ed 100644 --- a/core/htmldataprocessor.js +++ b/core/htmldataprocessor.js @@ -143,8 +143,17 @@ editor.on( 'toDataFormat', function( evt ) { + var data = evt.data.dataValue; + + // #10854 - we need to strip leading blockless
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
is higher. + if ( evt.data.enterMode != CKEDITOR.ENTER_BR ) + data = data.replace( /^/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 ) { From 2b63bf0f3e1818059bff24de09e9e79af85b084e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Fri, 25 Oct 2013 15:32:38 +0200 Subject: [PATCH 2/3] Simplified regexp pattern. --- core/htmldataprocessor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/htmldataprocessor.js b/core/htmldataprocessor.js index 11ae5a731ed..64d3cecc574 100644 --- a/core/htmldataprocessor.js +++ b/core/htmldataprocessor.js @@ -150,7 +150,7 @@ // We do that for every browser (so it's a constant behavior) and // not in BR mode, in which chance of valid leading blockless
is higher. if ( evt.data.enterMode != CKEDITOR.ENTER_BR ) - data = data.replace( /^/i, '' ); + data = data.replace( /^
/i, '' ); evt.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml( data, evt.data.context, getFixBodyTag( evt.data.enterMode, editor.config.autoParagraph ) ); From 39621ea4d192a656dbe8d012724271149cfc9fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Fri, 25 Oct 2013 15:35:48 +0200 Subject: [PATCH 3/3] Changelog entry. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 6c5486dec34..659c6abe5f7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 `
` to ``, so it is stripped by the HTML data processor. ## CKEditor 4.3 Beta