summaryrefslogtreecommitdiffstats
path: root/modules/markup/html_test.go
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2019-04-24 21:53:42 -0400
committertechknowlogick <techknowlogick@gitea.io>2019-04-24 21:53:41 -0400
commit0064535ad28f85fb8c84a0237ea02bd432c6a1f6 (patch)
tree8023f539a5072176ab4a3c1cc1b5678478cadb4f /modules/markup/html_test.go
parent6a58832286b9163337c1eddb892ecc5accdfa99f (diff)
downloadgitea-0064535ad28f85fb8c84a0237ea02bd432c6a1f6.tar.gz
gitea-0064535ad28f85fb8c84a0237ea02bd432c6a1f6.zip
Fix domain name pattern in email regex (#6739)
Fixes #6735
Diffstat (limited to 'modules/markup/html_test.go')
-rw-r--r--modules/markup/html_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go
index 543db1d462..daf953c9e6 100644
--- a/modules/markup/html_test.go
+++ b/modules/markup/html_test.go
@@ -177,6 +177,9 @@ func TestRender_email(t *testing.T) {
"info@gitea.com.",
`<p><a href="mailto:info@gitea.com" rel="nofollow">info@gitea.com</a>.</p>`)
test(
+ "firstname+lastname@gitea.com",
+ `<p><a href="mailto:firstname+lastname@gitea.com" rel="nofollow">firstname+lastname@gitea.com</a></p>`)
+ test(
"send email to info@gitea.co.uk.",
`<p>send email to <a href="mailto:info@gitea.co.uk" rel="nofollow">info@gitea.co.uk</a>.</p>`)
@@ -190,6 +193,18 @@ func TestRender_email(t *testing.T) {
test(
"git@try.gitea.io:go-gitea/gitea.git",
`<p>git@try.gitea.io:go-gitea/gitea.git</p>`)
+ test(
+ "gitea@3",
+ `<p>gitea@3</p>`)
+ test(
+ "gitea@gmail.c",
+ `<p>gitea@gmail.c</p>`)
+ test(
+ "email@domain@domain.com",
+ `<p>email@domain@domain.com</p>`)
+ test(
+ "email@domain..com",
+ `<p>email@domain..com</p>`)
}
func TestRender_ShortLinks(t *testing.T) {