diff --git a/src/core/js/ext_cosmetics.js b/src/core/js/ext_cosmetics.js index 4a3c57ad54a639def5806489275ccc88dac1d721..0cd67e575279df68ca4ad337f41c51f1a230ab9d 100644 --- a/src/core/js/ext_cosmetics.js +++ b/src/core/js/ext_cosmetics.js @@ -38,7 +38,7 @@ var cosmetics = new function () { var _linkify = function () { $('.caosdb-f-property-text-value').each(function (index) { - if (/https?:\/\//.test(this.innerText)) { + if (!($(this).hasClass("caosdb-v-property-linkified")) && (/https?:\/\//.test(this.innerText))) { var result = this.innerText.replace(/https?:\/\/[^\s]*/g, function (href, index) { var link_text = href; if (_link_cut_off_length > 4 && link_text.length > _link_cut_off_length) { @@ -48,6 +48,8 @@ var cosmetics = new function () { return `<a title="Open ${href} in a new tab." target="_blank" class="caosdb-v-property-href-value" href="${href}">${link_text} <i class="bi bi-box-arrow-up-right"></i></a>`; }); + // add class to highlight that this has been linkified already. + $(this).addClass("caosdb-v-property-linkified") $(this).hide(); $(this).after(result); }