diff --git a/js/qvitter.js b/js/qvitter.js index e1b7d9c..1136915 100644 --- a/js/qvitter.js +++ b/js/qvitter.js @@ -3385,13 +3385,7 @@ $('body').on('keyup', 'div.queet-box-syntax', function(e) { var cursorPosArray = getSelectionInElement(queetBox[0]); var cursorPos = cursorPosArray[0]; - // add space before linebreaks (to separate mentions in beginning of new lines when .text():ing later) - if(e.keyCode == '13') { - e.preventDefault(); - var range = createRangeFromCharacterIndices(queetBox[0], cursorPos, cursorPos); - range.insertNode(document.createTextNode(" \n")); - } - else if(e.keyCode != '40' && e.keyCode != '38' && e.keyCode != '13' && e.keyCode != '9') { + if(e.keyCode != '40' && e.keyCode != '38' && e.keyCode != '13' && e.keyCode != '9') { var contents = queetBox.text().substring(0,cursorPos); var mentionPos = contents.lastIndexOf('@'); var check_contents = contents.substring(mentionPos - 1, cursorPos); @@ -3459,13 +3453,7 @@ $('body').on('keyup', 'div.queet-box-syntax', function(e) { var cursorPosArray = getSelectionInElement(queetBox[0]); var cursorPos = cursorPosArray[0]; - // add space before linebreaks (to separate mentions in beginning of new lines when .text():ing later) - if(e.keyCode == '13') { - e.preventDefault(); - var range = createRangeFromCharacterIndices(queetBox[0], cursorPos, cursorPos); - range.insertNode(document.createTextNode(" \n")); - } - else if(e.keyCode != '40' && e.keyCode != '38' && e.keyCode != '13' && e.keyCode != '9') { + if(e.keyCode != '40' && e.keyCode != '38' && e.keyCode != '13' && e.keyCode != '9') { var contents = queetBox.text().substring(0,cursorPos); var mentionPos = contents.lastIndexOf('!'); var check_contents = contents.substring(mentionPos - 1, cursorPos);