From b6cab72b509e8873a4f3ccf4103709dd54fedaf9 Mon Sep 17 00:00:00 2001 From: Daniele Tonon Date: Sun, 28 May 2023 01:48:46 +0200 Subject: [PATCH] Parse and show video --- utils.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/utils.go b/utils.go index 4b3d1ec..633fbed 100644 --- a/utils.go +++ b/utils.go @@ -137,7 +137,6 @@ func ReplaceURLsWithTags(line string) string { regexPattern := fmt.Sprintf(`\s*(https?://\S+%s)\s*`, extension) regex := regexp.MustCompile(regexPattern) matches := regex.FindAllString(line, -1) - for _, match := range matches { imgTag := fmt.Sprintf(``, strings.ReplaceAll(match, "\n", "")) line = strings.ReplaceAll(line, match, imgTag) @@ -145,6 +144,19 @@ func ReplaceURLsWithTags(line string) string { } } + // Match and replace mp4 URLs with