<commit_before>alert("Hello from your Chrome extension!");

var list_commit_messages = $('.subject, .commit-message');

console.log(list_commit_messages);
list_commit_messages.each(function()
{
    var $this = $(this);
    var text = $this.text();


    var start1 = text.search(/(CORE\-\d\d\d\d|core\-\d\d\d\d)/);
    var start2 = text.search(/(CS\-\d\d\d\d|cs\-\d\d\d\d)/);
    //var start3 = text.search(/(TEMOB\-\d\d\d|temob\-\d\d\d)/);
    var start3 = null;
    var start4 = text.search(/(BEMOB\-\d\d\d\d|bemob\-\d\d\d\d)/);
    var start5 = text.search(/(MAINT\-\d\d\d\d|maint\-\d\d\d\d)/);

    if(start1 > -1)
    {
        replaceLink(start1, 9);
        start3 = text.search(/(TEMOB\-\d\d\d|temob\-\d\d\d)/);
    }

    if(start2 > -1)
    {
        replaceLink(start2, 7);
    }


    console.log(start3);
    if(start3 > -1)
    {
        replaceLink(start3, 9);
    }

    if(start4 > -1)
    {
        replaceLink(start4, 10);
    }


    if(start4 > -1)
    {
        replaceLink(start4, 10);
    }

    $this.html(text);

    function replaceLink(start, length)
    {
        var ticket = text.substr(start, length);
        text = text.replace(ticket, '<a href=http://google.com>' + ticket + '</a>');
    }

});

<commit_msg>somewhat works<commit_after>function doTask()
{
    var list_messages = $('.subject, .commit-message');

    list_messages.each(function()
    {
        var $this = $(this);
        var text = $this.text();
        var filter = [
                         ['(CORE\\-\\d\\d\\d\\d|core\\-\\d\\d\\d\\d)', 9]
                        ,['(CS\\-\\d\\d\\d\\d|cs\\-\\d\\d\\d\\d)', 7]
                        ,['(BEMOB\\-\\d\\d\\d\\d|bemob\\-\\d\\d\\d\\d)', 10]
                        ,['(BEMOB\\-\\d\\d\\d\\D|bemob\\-\\d\\d\\d\\D)', 9]
                        ,['(TEMOB\\-\\d\\d\\d\\d|temob\\-\\d\\d\\d\\d)', 10]
                        ,['(TEMOB\\-\\d\\d\\d\\D|temob\\-\\d\\d\\d\\D)', 9]
                        ,['(MAINT\\-\\d\\d\\d\\d|maint\\-\\d\\d\\d\\d)', 10]
                        ,['(MAINT\\-\\d\\d\\d[\\D\\S]|maint\\-\\d\\d\\d)', 9]
                        ,['(DEP\\-\\d\\d\\d|dep\\-\\d\\d\\d)', 7]
                     ];

        for(var i=0,l=filter.length; i < l; i++)
        {
            var regex = new RegExp(filter[i][0]);
            var start = text.search(regex);

            if(start > -1)
            {
                replaceLink(start, filter[i][1]);
            }
        };

        $this.html(text);

        function replaceLink(start, length)
        {
            var ticket = text.substr(start, length);
            text = text.replace(ticket, '<a href=http://issues.buildingengines.com/browse/' + ticket + '>' + ticket + '</a>');
        };
    });
};

$(document).on('click', function()
{
    window.setTimeout(doTask(), 2000);


});
doTask();
{'fraction_non_alphanumeric': 0.24795737122557726, 'fraction_numerical': 0.017761989342806393, 'mean_word_length': 1.423407917383821, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '162692', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1056, 'n_words': 142}