From f1f2305e8293f61b21382444fa70e3a961da1cb0 Mon Sep 17 00:00:00 2001 From: Ryan Stafford Date: Wed, 5 Jul 2023 11:00:14 -0400 Subject: [PATCH] fix youtube link false positive --- public/utils.js | 1 + templates/frontpage.html | 2 +- templates/main.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/utils.js b/public/utils.js index f3b0be9..ee63829 100644 --- a/public/utils.js +++ b/public/utils.js @@ -92,6 +92,7 @@ function formSubmit(e) { } function parse_youtube(url){ + if (url.indexOf("youtu") == -1) return false var regExp = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/; var match = url.match(regExp); if (match && match.length > 1) { diff --git a/templates/frontpage.html b/templates/frontpage.html index 394c037..f6b75d6 100644 --- a/templates/frontpage.html +++ b/templates/frontpage.html @@ -48,6 +48,6 @@ {{ template "sidebar.html" . }} {{ end }} - + diff --git a/templates/main.html b/templates/main.html index f7ad858..3672a19 100644 --- a/templates/main.html +++ b/templates/main.html @@ -120,7 +120,7 @@ {{ end }} - + {{ template "sidebar.html" . }} {{ end }}