From c7c3fab8e41e1d287cd8e9fbd63491e7ef11e488 Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Tue, 7 Aug 2018 10:27:45 +0100 Subject: [PATCH] Clickable URLs in HTML exporter. Closes #1696. --- .../exporters/CustomizableTabularExporterUtilities.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java b/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java index d7e6d334d..d583d0450 100644 --- a/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java +++ b/main/src/com/google/refine/exporters/CustomizableTabularExporterUtilities.java @@ -33,6 +33,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package com.google.refine.exporters; +import java.net.MalformedURLException; +import java.net.URL; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.OffsetDateTime; @@ -348,6 +350,13 @@ abstract public class CustomizableTabularExporterUtilities { if (text == null) { if (value instanceof String) { text = (String) value; + + if(text.contains(":")) { + try { + link = new URL(text).toString(); + } catch (MalformedURLException e) { + } + } } else if (value instanceof OffsetDateTime) { text = ((OffsetDateTime) value).format(DateTimeFormatter.ISO_INSTANT); } else {