Skip to content

Commit

Permalink
function removePlaceholder to check editor.enterMode
Browse files Browse the repository at this point in the history
This change is essentially the fix for issue AlfonsoML#7
  • Loading branch information
JulesAchiel authored May 30, 2019
1 parent 81f70b1 commit fcf8850
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
root.removeClass( 'placeholder' );
// fill it properly
if (CKEDITOR.dtd[ root.getName() ]['p']) {
root.setHtml( '<p><br/></p>' );
root.setHtml( editor.enterMode === CKEDITOR.ENTER_P ? '<p><br/></p>' : (editor.enterMode === CKEDITOR.ENTER_DIV ? '<div><br/></div>' : '<br/>') );
// Set caret in position
var range = new CKEDITOR.dom.range(editor.document);
range.moveToElementEditablePosition(root.getFirst(), true);
Expand Down

0 comments on commit fcf8850

Please sign in to comment.