From 4d953be31d18a31fd080111d390026078f0bd29d Mon Sep 17 00:00:00 2001 From: Quincy Morgan <2046746+quincylvania@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:04:51 -0400 Subject: [PATCH] Hyperlink tag values that link to external pages and tag keys (close #85) --- js/sidebarController.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/js/sidebarController.js b/js/sidebarController.js index 60784c0..5497dec 100644 --- a/js/sidebarController.js +++ b/js/sidebarController.js @@ -112,13 +112,30 @@ function updateMetaTable(entity, changeset) { document.getElementById('meta-table').innerHTML = html; } +const urlRegex = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/i; +const qidRegex = /^Q\d+$/; +const wikipediaRegex = /^(.+):(.+)$/; +const nwisRegex = /^\d{8,15}$/; + function updateTagsTable(tags) { let html = ""; html += `