Created
March 17, 2020 21:25
-
-
Save fhdalikhan/859a207c94736d973057d91a4a31d194 to your computer and use it in GitHub Desktop.
ckeditor allow all tags and their css classes etc and stop editor creating an empty paragraph along with option to insert paragraph when it is disabled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CKEDITOR.replace( 'ck-editor', { | |
| allowedContent: true | |
| }; | |
| CKEDITOR.editorConfig = function( config ) { | |
| config.enterMode = 2; | |
| }; | |
| And this will give you both the <p> and <br> tag when needed but does not prevent | |
| the start and stop <p> tag | |
| CKEDITOR.editorConfig = function( config ) { | |
| config.enterMode = CKEDITOR.ENTER_BR // pressing the ENTER Key puts the <br/> tag | |
| config.shiftEnterMode = CKEDITOR.ENTER_P; //pressing the SHIFT + ENTER Keys puts the <p> tag | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment