diff --git a/zerver/models.py b/zerver/models.py index 80cf489792..328998aab0 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -526,12 +526,14 @@ class Message(models.Model): domain = "mit.edu/zephyr_mirror" rendered_content = bugdown.convert(content, domain, self) - # For /me syntax, we pass back the raw content. The JS can detect /me + # For /me syntax, we pass back a /me prefix. The JS can detect /me # (no paragraph tag) and do special rendering. We might eventually # want to handle this with a flag, but it's a bit tough to deliver the # flag through all code paths, given the current code structure. - if content.startswith('/me ') and rendered_content == '
%s
' % (content,): - return content + if content.startswith('/me ') and '\n' not in content: + if rendered_content.startswith('') and rendered_content.endswith('
'): + rendered_content = rendered_content[3:-4] + return rendered_content return rendered_content