From: Mike Taylor Date: Tue, 30 Jun 2015 10:10:47 +0000 (+0100) Subject: Tidying up after ACREP-32. X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=a6921ecbf975ae32008c7b18f437d3f3b4773d6e;p=mkws-moved-to-github.git Tidying up after ACREP-32. Remove another extraneous warning from URL analysis. Warn when seeing a so-called link that is not a valid URL. --- diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index e539e6d..f1b13e0 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -140,12 +140,13 @@ mkws.registerWidgetType('records', function() { } var urls = hit['md-electronic-url']; - that.warn("urls = " + mkws.$.toJSON(urls)); var bestLink = null; var otherLinks = []; for (var j = 0; j < urls.length; j++) { var url = urls[j]; - if (!bestLink && url.match(/^(https?:)?\/\//)) { + if (!url.match(/^(https?:)?\/\//)) { + that.warn("link '" + url + "' is not a valid URL"); + } else if (!bestLink) { bestLink = url; } else { otherLinks.push(url);