String.prototype.replaceAll = function(search, replace)
{
    //if replace is not sent, return original string otherwise it will
    //replace search string with 'undefined'.
    if (replace === undefined) {
        return this.toString();
    }

    return this.replace(new RegExp('[' + search + ']', 'g'), replace);
};


var repoFromLink = window.location.pathname.split("/")[2];

listRepositories(function(repos){
    var repo = repos.find(repo => repo.scm == repoFromLink);
    if(repo){
      processRepo(repo);
    }
});

function processRepo(repo){
  var commentBody = $(".comment-body, .commit-title, .commit-desc");
  var splittedBody = commentBody.text().split(" ");
  for( var i in splittedBody){
    var text = splittedBody[i];
    if (splittedBody[i].indexOf(repo.keyword) > -1){
      //Clean the link from some symbols usually added to destinguish issue-id from commit message
      var cleanedText = text.replaceAll("[", "").replaceAll("\\]", "").replaceAll("#", "");
      commentBody.html(commentBody.html().replace(text, '<a href="' + repo.targetURL + cleanedText + '">' + text + '</a>'));
    }
  }
}

@@ -422,16 +422,17 @@
 var repo
+s
  = repos
@@ -434,18 +434,20 @@
 repos.fi
-nd
+lter
 (repo =%3E
@@ -481,24 +481,25 @@
 %0A    if(repo
+s
 )%7B%0A      pro
@@ -511,16 +511,17 @@
 epo(repo
+s
 );%0A    %7D
@@ -551,16 +551,17 @@
 epo(repo
+s
 )%7B%0A  var
@@ -739,16 +739,70 @@
 ody%5Bi%5D;%0A
+    for(var j in repos)%7B%0A      var repo = repos%5Bj%5D;%0A  
     if (
@@ -846,16 +846,47 @@
  %3E -1)%7B%0A
+        console.log(%22here%22);%0A  
       //
@@ -978,24 +978,26 @@
 ssage%0A      
+  
 var cleanedT
@@ -1066,24 +1066,26 @@
 l(%22#%22, %22%22);%0A
+  
       commen
@@ -1197,16 +1197,24 @@
 /a%3E'));%0A
+      %7D%0A
     %7D%0A  

Add support for multiple issue keywords in the same repo