mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
markdown: Make raw urls in topic names navigable.
We reuse the link regexes we use elsewhere inn markdown for parsing links in topic names and add a button to open them in new tabs similar to our behavior with linkifiers in topic names. Fixes #12391.
This commit is contained in:
committed by
Tim Abbott
parent
96d7c1f3b0
commit
047086b81c
@@ -160,6 +160,14 @@ exports.add_topic_links = function (message) {
|
||||
links.push(link_url);
|
||||
}
|
||||
});
|
||||
|
||||
// Also make raw urls navigable
|
||||
var url_re = /\b(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/g; // Slightly modified from third/marked.js
|
||||
var match = topic.match(url_re);
|
||||
if (match) {
|
||||
links = links.concat(match);
|
||||
}
|
||||
|
||||
util.set_topic_links(message, links);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user