Commit a90fd457 authored by Camil Staps's avatar Camil Staps 🍃

Workaround for contenteditable bug in firefox (present up to 63.0b9) when...

Workaround for contenteditable bug in firefox (present up to 63.0b9) when enter is pressed when the cursor stands after a whitespace character
parent 3f773010
......@@ -1005,7 +1005,11 @@ if (make_content_editable) {
// add a space at the start.
caret = 0;
}
var val = this.innerText.replace(/^\s+|\n\n$/g, '').replace(/\n$/, '\u00a0').replace(/\n/g, '');
var val = this.innerText
.replace(/^\s+|\n\n$/g, '')
.replace(/\n$/, '\u00a0')
.replace(/\n/g, navigator.userAgent.indexOf('Firefox') != -1 ? ' ' : '');
// Behaviour of pressing enter after a space differs from browser to browser
var html = highlightQuery(val);
if (html == '') {
html = '<span id="caret-spacer"></span>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment