Hi,
I have a problem with enterMode=BR and Blockquote. Using CKEDITOR 4 with <br /> for new lines instead of paragraphs doesn't work for Blockquote.
It's impossible to exit blockquote with an editor configured as enterMode: CKEDITOR.ENTER_BR
You can make the same mistake with online demo :
- GOTO : http://ckeditor.com/demo
- Set enterMode in console browser with : CKEDITOR.instances.editor1.config.enterMode = CKEDITOR.ENTER_BR
- And just press ENTER in a blockquote

First of all, you cannot
First of all, you cannot change configuration option during runtime. It may have unpredictable consequences.
Therefore, I'm testing this case on samples/enterkey.html by changing enterMode in dropdown.
And I see that enter works exactly like it is indented to work. It adds new line (inserts <br>) in blockquote. To leave blockquote you need to move caret by a down arror or magicline if the blockqoute is at the end of your document.
There's a difference between enterMode=BR and enterMode=P. In the latter one enter pressed twice leaves blockquote. In BR mode it would be unwise to do that, because users often uses double enter to create "paragraph-like" break between lines. This is a downside of using enterMode=BR.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
And can I use a function to
And can I use a function to break blockquote with enterMode : BR ?
I don't know about such a
I don't know about such a function. You would hav to write it by yourself.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
"CKEditor JavaScript
"CKEditor JavaScript Developer (aka JavaScript ninja)"
OK ...
I'm glad you liked my
I'm glad that you liked my signature ;)
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
I found this :
I found this :
range.deleteContents();
range.insertNode( lineBreak );
// START
var startBlockParent = startBlock && startBlock.getParent();
if ( startBlockParent && startBlockParent.is( 'blockquote' ) )
{
var previous = lineBreak.getPrevious( CKEDITOR.dom.walker.whitespaces(1) ),
next = lineBreak.getNext( CKEDITOR.dom.walker.whitespaces(1) );
var isStartOfParent = range.checkBoundaryOfElement( startBlockParent, CKEDITOR.START ),
isEndOfParent = range.checkBoundaryOfElement( startBlockParent, CKEDITOR.END ),
isStartOfLine = isStartOfParent || ( previous && previous.is && previous.is( 'br' ) ),
isEndOfLine = isEndOfParent || ( next && next.is && next.is( 'br' ) );
if ( isStartOfLine && isEndOfLine )
{
if ( isStartOfParent )
lineBreak.remove().insertBefore( startBlockParent );
else if ( isEndOfParent )
lineBreak.remove().insertAfter( startBlockParent );
else
lineBreak.breakParent( startBlockParent );
isStartOfParent && isEndOfParent && startBlockParent.remove();
// The "next" <br> is not needed any more at this point.
next && next.remove();
// Except on IE, the previous and the new <br> will remain as bogus <br>s.
if ( CKEDITOR.env.ie && previous )
previous.remove();
range.moveToPosition( lineBreak, CKEDITOR.POSITION_BEFORE_START );
if ( CKEDITOR.env.ie )
lineBreak.remove();
range.select();
return;
}
}
// END
// IE has different behavior regarding position.
if ( CKEDITOR.env.ie )
But I think this patch is incomplete ...