markdown: Parse '/me' for multi-line messages.

Previously, messages with more than one line did not parse '/me' at
the beginning of the message.  Since there's a reasonable way to
render multi-line messages, this commit adds support for doing so.

This change does potentially break with the expected behavior of other
slash commands, but it seems worth providing useful functionality over
a blind focus on consistency.

Fixes #11025.
This commit is contained in:
Vaibhav
2018-12-29 15:37:27 +05:30
committed by Tim Abbott
parent 5a8ad84381
commit 93914d8cd8
4 changed files with 10 additions and 6 deletions

View File

@@ -136,9 +136,8 @@ exports.add_topic_links = function (message) {
exports.is_status_message = function (raw_content, content) {
return raw_content.indexOf('/me ') === 0 &&
raw_content.indexOf('\n') === -1 &&
content.indexOf('<p>') === 0 &&
content.lastIndexOf('</p>') === content.length - 4;
content.indexOf('</p>') !== -1;
};
function handleUnicodeEmoji(unicode_emoji) {