This is an automated email from the ASF dual-hosted git repository.
rbowen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/comdev-events-site.git
The following commit(s) were added to refs/heads/main by this push:
new 772cb4f Strip HTML from event link
772cb4f is described below
commit 772cb4f21481c19fa236a294d180da7d7892d93d
Author: Rich Bowen <[email protected]>
AuthorDate: Mon Jun 15 15:37:34 2026 -0400
Strip HTML from event link
The Google Calendar UI will often add HTML to the event link. The
javascript expects just a plain text URL with no markup. This patch
makes it work in both cases.
---
static/js/events-calendar.js | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/static/js/events-calendar.js b/static/js/events-calendar.js
index 0cef93f..c2f2541 100644
--- a/static/js/events-calendar.js
+++ b/static/js/events-calendar.js
@@ -38,10 +38,16 @@ $.ajax({
var link = null;
if (ev.description) {
var line1 = ev.description.split("\n")[0];
- if (line1.slice(0,7) === "http://" ||
- line1.slice(0,8) === "https://"
- ) {
- link = line1.trim();
+ // Strip HTML tags to extract bare URL
+ // Google Calendar often wraps URLs in <a href="...">...</a>
+ var hrefMatch = line1.match(/href=["']([^"']+)["']/);
+ if (hrefMatch) {
+ link = hrefMatch[1].trim();
+ } else {
+ var stripped = line1.replace(/<[^>]*>/g, '').trim();
+ if (stripped.match(/^https?:\/\//)) {
+ link = stripped;
+ }
}
}