mirror of https://github.com/zulip/zulip.git
markdown: Make backend status message detection logic mimic frontend.
In 93914d8cd8
, we intended to change our
markdown processor to add support for multi-line /me messages.
However, we neglected to change the backend processor, resulting in
the change only taking effect for the user sending the message :(.
We fix this by changing the backend processor too.
Fixes #12450.
This commit is contained in:
parent
4489df7cd6
commit
c03efd2971
|
@ -1637,7 +1637,7 @@ class Message(AbstractMessage):
|
|||
"""
|
||||
Returns True if content and rendered_content are from 'me_message'
|
||||
"""
|
||||
if content.startswith('/me ') and '\n' not in content:
|
||||
if content.startswith('/me '):
|
||||
if rendered_content.startswith('<p>') and rendered_content.endswith('</p>'):
|
||||
return True
|
||||
return False
|
||||
|
|
|
@ -958,7 +958,7 @@ class BugdownTest(ZulipTestCase):
|
|||
rendered_content,
|
||||
'<p>/me writes a second line<br>\nline</p>'
|
||||
)
|
||||
self.assertFalse(Message.is_status_message(content, rendered_content))
|
||||
self.assertTrue(Message.is_status_message(content, rendered_content))
|
||||
|
||||
def test_alert_words(self) -> None:
|
||||
user_profile = self.example_user('othello')
|
||||
|
|
Loading…
Reference in New Issue