Y
Y
YourQuestion2015-02-04 10:02:23
WYSIWYG
YourQuestion, 2015-02-04 10:02:23

Wysihtml5 bootstrap - how to prevent trimming of empty lines (cuts an empty line if you press Enter 2 times after the last line)?

Good afternoon.
Using wysihtml5 bootstrap ran into a problem that it can't indent after the last line. Those. if after the last line you try to press Enter twice, then there will be no double line wrapping (the second empty line will be deleted and the cursor will rise to the line following the last line with text).
Does anyone know how to prevent blank lines from being trimmed?
By the way, he indents only the cursor translates one line up. How can I make the cursor go to the next empty line after pressing Enter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WebEditor, 2015-02-04
@YourQuestion

Step 1: In the wysihtml5-0.3.0.js file , comment out the code on lines 5869 - 5870:

composer.commands.exec("insertLineBreak");
event.preventDefault();

You should have like this:
if (keyCode === wysihtml5.ENTER_KEY && !wysihtml5.browser.insertsLineBreaksOnReturn()) {
//composer.commands.exec("insertLineBreak");
//event.preventDefault();
}

Step 2: In the wysihtml5-0.3.0.js file , comment out the code on line 8847
. should be like this:
if (keyCode === wysihtml5.ENTER_KEY) {
          //callbackWrapper(event);
        }

And everything will work as it should.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question