Skip to content

Instantly share code, notes, and snippets.

@adamkudrna
Created July 27, 2015 19:42
Show Gist options
  • Save adamkudrna/84b44f18d91afdf136aa to your computer and use it in GitHub Desktop.
Save adamkudrna/84b44f18d91afdf136aa to your computer and use it in GitHub Desktop.
CKEditor nbsp plugin
/**
* @file insert Non-Breaking SPace for CKEditor
* Copyright (C) 2014 Alfonso Martínez de Lizarrondo
* Create a command and enable the Ctrl+Space shortcut to insert a non-breaking space in CKEditor
*
*/
CKEDITOR.plugins.add( 'nbsp',
{
init : function( editor )
{
// Insert   if Ctrl+Space is pressed:
editor.addCommand( 'insertNbsp', {
exec: function( editor ) {
editor.insertHtml( ' ' );
}
});
editor.setKeystroke( CKEDITOR.CTRL + 32 /* space */, 'insertNbsp' );
}
} );
@adamkudrna
Copy link
Author

Download from http://ckeditor.com/addon/nbsp, does not have public repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment