Commit 4dc9851c authored by Camil Staps's avatar Camil Staps 🍃

Properly fix the issue from a90fd457: don't add \n to the input field in the first place

parent 78ab91bc
......@@ -997,11 +997,7 @@ 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, navigator.userAgent.indexOf('Firefox') != -1 ? ' ' : '');
// Behaviour of pressing enter after a space differs from browser to browser
var val = this.innerText.replace(/^\s+/, '');
var html = highlightQuery(val);
if (html == '') {
html = '<span id="caret-spacer"></span>';
......@@ -1015,6 +1011,7 @@ if (make_content_editable) {
form_str.onkeydown = function(e) {
if (e.keyCode == 13) {
formsubmit();
return false;
}
};
form_str.oninput();
......
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