Adds some hyperlink functionality

Used some regex and JS .replace function. Enjoy.
This commit is contained in:
the-og-gear
2020-04-27 14:06:49 -04:00
committed by the-og-gear
parent ab179d74a2
commit 51828bd5a8

View File

@@ -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])) {