Answer the question
In order to leave comments, you need to log in
How to prevent CKEditor from adding spaces ( )?
When entering text, CKEditor allows you to enter multiple spaces in a row, replacing them with the
Is there a way to prevent the editor from automatically inserting (leaving only the ability to insert a non-breaking space using the CTRL + SHIFT + SPACE combination)? The path just inserts spaces. I will remove them later.
Answer the question
In order to leave comments, you need to log in
CKEDITOR.on('instanceReady', function(ev) {
ev.editor.on('paste', function(evt) {
evt.data.dataValue = evt.data.dataValue.replace(/ /g,' ');
evt.data.dataValue = evt.data.dataValue.replace(/<p><\/p>/g,' ');
console.log(evt.data.dataValue);
}, null, null, 9);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question