fix youtube link false positive

This commit is contained in:
Ryan Stafford 2023-07-05 11:00:14 -04:00
parent 5a24937781
commit f1f2305e82
3 changed files with 3 additions and 2 deletions

View file

@ -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) {

View file

@ -48,6 +48,6 @@
{{ template "sidebar.html" . }}
</main>
{{ end }}
<script src="/_/static/utils.js?1"></script>
<script src="/_/static/utils.js?2"></script>
</body>
</html>

View file

@ -120,7 +120,7 @@
</div>
{{ end }}
<script src="/_/static/utils.js?1"></script>
<script src="/_/static/utils.js?2"></script>
{{ template "sidebar.html" . }}
</main>
{{ end }}