Darkle The code itself is relatively simplistic in the sense that it looks for IMG tags, and then adds a HREF wrapper
<script>
flarum.core.compat.extend.extend(flarum.core.compat['components/CommentPost'].prototype, 'oncreate', function (output, vnode) {
const self = this;
this.$('img').not('.emoji').not(".Avatar").not($(".PostMeta-ip img")).each(function () {
var currentImage = $(this);
var checksrc = currentImage.attr("data-src");
if (checksrc) {
$(this).wrap("<a class=\"fancybox\" href='" + currentImage.attr("data-src") + "'></a>");
}
else {
$(this).wrap("<a class=\"fancybox\" href='" + currentImage.attr("src") + "'></a>");
}
try {
$().ready(function(){
$().fancybox({
selector: '.fancybox'
});
})
} catch (e) {
console.error(e.name);
console.error(e.message);
}
});
});
</script>
My guess is that this could be coming from the Fancybox library itself rather than this extension.