mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
markdown: Move code related to @mentions to markdown.js.
For consistency, we should keep all the code that works with @mentions in markdown.js. In this case, message_list_view was rewriting the contents of the mentions in cases where users' names had been changed since we rendered their mention.
This commit is contained in:
committed by
Tim Abbott
parent
44ec83ef28
commit
92658d2ac9
@@ -36,6 +36,15 @@ var backend_only_markdown_re = [
|
||||
/[^\s]*(?:twitter|youtube).com\/[^\s]*/,
|
||||
];
|
||||
|
||||
// Helper function to update a mentioned user's name.
|
||||
exports.set_name_in_mention_element = function (element, name) {
|
||||
if ($(element).hasClass('silent')) {
|
||||
$(element).text(name);
|
||||
} else {
|
||||
$(element).text("@" + name);
|
||||
}
|
||||
};
|
||||
|
||||
exports.contains_backend_only_syntax = function (content) {
|
||||
// Try to guess whether or not a message has bugdown in it
|
||||
// If it doesn't, we can immediately render it client-side
|
||||
|
||||
Reference in New Issue
Block a user