mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Support emojis/bolding/etc. in single-line /me messages.
(imported from commit c62ae8cf26117e30a029e025021cc4a3a67f4a83)
This commit is contained in:
parent
fe0dcd4313
commit
220678ae40
@ -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 == '<p>%s</p>' % (content,):
|
||||
return content
|
||||
if content.startswith('/me ') and '\n' not in content:
|
||||
if rendered_content.startswith('<p>') and rendered_content.endswith('</p>'):
|
||||
rendered_content = rendered_content[3:-4]
|
||||
return rendered_content
|
||||
|
||||
return rendered_content
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user