Skip to content

Commit

Permalink
fix browser regex support
Browse files Browse the repository at this point in the history
  • Loading branch information
octavioamu committed Feb 17, 2020
1 parent 8b1cdca commit 53c422b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/assets/v2/js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
$(document).ready(function() {

var linkify = function(new_text) {
new_text = new_text.replace(/(?<!\S)#(\w*)/g, ' <a href="/?tab=search-$1">#$1</a>');
new_text = new_text.replace(/(?:^|\s)#([a-zA-Z\d-]+)/g, ' <a href="/?tab=search-$1">#$1</a>');
new_text = new_text.replace(/\B@(\w*)/g, ' <a href="/profile/$1">@$1</a>');
console.log(new_text)
return new_text;
};
// inserts links into the text where there are URLS detected
Expand Down

0 comments on commit 53c422b

Please sign in to comment.