mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-17 13:42:44 +00:00
Adds some hyperlink functionality
Used some regex and JS .replace function. Enjoy.
This commit is contained in:
@@ -578,6 +578,10 @@ function start_vue() {
|
||||
}
|
||||
}
|
||||
|
||||
newmessage.content = newmessage.content.replace(
|
||||
/(\b(https?|ftp|file):\/\/[\-A-Z0-9+&@#\/%?=~_|!:,.;]*[\-A-Z09+&@#\/%=~_|])/img, //Honestly good luck with this regex ~Gear
|
||||
'<a href="$1">$1</a>');
|
||||
|
||||
//Unread indicator and insertion into current tab shown messages if sensible
|
||||
if(this.current_categories.length && (this.current_categories.indexOf(newmessage.category) < 0)) { //Not in the current categories
|
||||
if (isNaN(this.unread_messages[newmessage.category])) {
|
||||
|
||||
Reference in New Issue
Block a user