Remove trim for drafts

Closes #1188
This commit is contained in:
Igor Zhukov 2016-07-11 21:08:54 +03:00
parent 25681537c7
commit 63d4cfe5ba
2 changed files with 3 additions and 3 deletions

View File

@ -1399,7 +1399,7 @@ angular.module('izhukov.utils', [])
}) })
} }
function parseMarkdown (text, entities) { function parseMarkdown (text, entities, noTrim) {
if (text.indexOf('`') == -1 && text.indexOf('@') == -1) { if (text.indexOf('`') == -1 && text.indexOf('@') == -1) {
return text.trim() return text.trim()
} }
@ -1461,7 +1461,7 @@ angular.module('izhukov.utils', [])
newText = text newText = text
entities.splice(0, entities.length) entities.splice(0, entities.length)
} }
if (!entities.length) { if (!entities.length && !noTrim) {
newText = newText.trim() newText = newText.trim()
} }
return newText return newText

View File

@ -4643,7 +4643,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
var message = localDraft.text var message = localDraft.text
var entities = [] var entities = []
message = RichTextProcessor.parseEmojis(message) message = RichTextProcessor.parseEmojis(message)
message = RichTextProcessor.parseMarkdown(message, entities) message = RichTextProcessor.parseMarkdown(message, entities, true)
if (localDraft.replyToMsgID > 0) { if (localDraft.replyToMsgID > 0) {
params.flags |= 1 params.flags |= 1
params.reply_to_msg_id = localDraft.replyToMsgID params.reply_to_msg_id = localDraft.replyToMsgID