<commit_before>﻿$(function () {

    var imageExtensions = ["jpg", "jpeg", "png", "gif", "bmp", "tif", "tiff"];

    var containerQuery = "#content";

    var processLinksWithImageInsideOnly = false;
    var processLinksToImageOnly = true;

    $(containerQuery).find("a").each(function(index, link) {
        var processLink = true;
        var uri = new URI($(link).attr("href"));
        if (processLinksWithImageInsideOnly) {
            processLink &= $(link).children("img").length == 1;
        }
        if (processLink && processLinksToImageOnly) {
            var isLinkToImage = false;
            var i = 0;
            while (!isLinkToImage && i < imageExtensions.length) {
                isLinkToImage |= $.inArray(uri.suffix(), imageExtensions) >= 0;
                i++;
            }
            processLink &= isLinkToImage;
        }
        if (processLink) {
            $(link).colorbox();
        }
    });
    
});<commit_msg>Ignore empty and local anchors; suffix fix.<commit_after>﻿$(function () {

    var imageExtensions = ["jpg", "jpeg", "png", "gif", "bmp", "tif", "tiff"];

    var containerQuery = "#content";

    var processLinksWithImageInsideOnly = false;
    var processLinksToImageOnly = true;

    $(containerQuery).find("a").each(function(index, link) {
        var linkUrl = $(link).attr("href");
        if (!linkUrl || linkUrl.length < 1 || linkUrl[0] === "#") {
            return;
        }
        var processLink = true;
        var uri = new URI(linkUrl);
        if (processLinksWithImageInsideOnly) {
            processLink &= $(link).children("img").length == 1;
        }
        if (processLink && processLinksToImageOnly) {
            var suffix = uri.suffix();
            processLink &= suffix && suffix.length > 0 && $.inArray(suffix, imageExtensions) >= 0;
        }
        if (processLink) {
            $(link).colorbox();
        }
    });
    
});
{'fraction_non_alphanumeric': 0.15629900679560899, 'fraction_numerical': 0.004181913225300575, 'mean_word_length': 2.2114093959731544, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '4723973', 'n_tokens_mistral': 562, 'n_tokens_neox': 532, 'n_words': 120}