mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
markdown: Remove redundant checks from /me.
If a message begins with /me, we do not have any cases where the rendered content would not begin with `<p>/me`. Thus, we can safely remove the redundant checks both on the backend and frontend.
This commit is contained in:
committed by
Tim Abbott
parent
3df18c365d
commit
85c669e366
@@ -129,7 +129,7 @@ exports.apply_markdown = function (message) {
|
||||
};
|
||||
// Our python-markdown processor appends two \n\n to input
|
||||
message.content = marked(message.raw_content + '\n\n', options).trim();
|
||||
message.is_me_message = exports.is_status_message(message.raw_content, message.content);
|
||||
message.is_me_message = exports.is_status_message(message.raw_content);
|
||||
};
|
||||
|
||||
exports.add_topic_links = function (message) {
|
||||
@@ -168,10 +168,8 @@ exports.add_topic_links = function (message) {
|
||||
util.set_topic_links(message, links);
|
||||
};
|
||||
|
||||
exports.is_status_message = function (raw_content, content) {
|
||||
return raw_content.indexOf('/me ') === 0 &&
|
||||
content.indexOf('<p>') === 0 &&
|
||||
content.indexOf('</p>') !== -1;
|
||||
exports.is_status_message = function (raw_content) {
|
||||
return raw_content.indexOf('/me ') === 0;
|
||||
};
|
||||
|
||||
function make_emoji_span(codepoint, title, alt_text) {
|
||||
|
||||
Reference in New Issue
Block a user