diff --git a/app/js/lib/ng_utils.js b/app/js/lib/ng_utils.js index 4e9a4c93..305f27bb 100644 --- a/app/js/lib/ng_utils.js +++ b/app/js/lib/ng_utils.js @@ -1399,7 +1399,7 @@ angular.module('izhukov.utils', []) }) } - function parseMarkdown (text, entities) { + function parseMarkdown (text, entities, noTrim) { if (text.indexOf('`') == -1 && text.indexOf('@') == -1) { return text.trim() } @@ -1461,7 +1461,7 @@ angular.module('izhukov.utils', []) newText = text entities.splice(0, entities.length) } - if (!entities.length) { + if (!entities.length && !noTrim) { newText = newText.trim() } return newText diff --git a/app/js/services.js b/app/js/services.js index a031a469..62e6b8bf 100755 --- a/app/js/services.js +++ b/app/js/services.js @@ -4643,7 +4643,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) var message = localDraft.text var entities = [] message = RichTextProcessor.parseEmojis(message) - message = RichTextProcessor.parseMarkdown(message, entities) + message = RichTextProcessor.parseMarkdown(message, entities, true) if (localDraft.replyToMsgID > 0) { params.flags |= 1 params.reply_to_msg_id = localDraft.replyToMsgID