From f5a423f2d547daaba452063e741af7c3dfc72299 Mon Sep 17 00:00:00 2001 From: Ryan Stafford Date: Fri, 28 Jul 2023 13:04:41 -0400 Subject: [PATCH] remove mailto links from title --- routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes.go b/routes.go index da65011..754739b 100644 --- a/routes.go +++ b/routes.go @@ -152,7 +152,7 @@ var funcMap = template.FuncMap{ return body } text := html2text.HTML2TextWithOptions(buf.String(), html2text.WithLinksInnerText()) - re := regexp.MustCompile(`\`) + re := regexp.MustCompile(`\<(https?:\/\/|mailto)(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)\>`) return re.ReplaceAllString(text, "") }, "contains": strings.Contains,