Skip to content

Commit e6620a3

Browse files
committed
more test cases
1 parent 93c39b1 commit e6620a3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/markup/html_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,14 @@ func TestRender_email(t *testing.T) {
290290
input, expected string
291291
}{
292292
// match GitHub behavior
293-
{"[email protected]", `<p>?<a href="mailto:[email protected]" rel="nofollow">[email protected]</a></p>`},
294-
{"*[email protected]", `<p>*<a href="mailto:[email protected]" rel="nofollow">[email protected]</a></p>`},
295-
{"[email protected]", `<p>~<a href="mailto:[email protected]" rel="nofollow">[email protected]</a></p>`},
293+
{"[email protected]", `<p>?<a href="mailto:[email protected]" rel="nofollow">[email protected]</a></p>`},
294+
{"*[email protected]", `<p>*<a href="mailto:[email protected]" rel="nofollow">[email protected]</a></p>`},
295+
{"[email protected]", `<p>~<a href="mailto:[email protected]" rel="nofollow">[email protected]</a></p>`},
296+
297+
// the following cases don't match GitHub behavior, but they are valid email addresses ...
298+
// maybe we should reduce the candidate characters for the "name" part in the future
299+
{"a*[email protected]", `<p><a href="mailto:a*[email protected]" rel="nofollow">a*[email protected]</a></p>`},
300+
{"[email protected]", `<p><a href="mailto:[email protected]" rel="nofollow">[email protected]</a></p>`},
296301
}
297302
for _, c := range cases {
298303
test(c.input, c.expected)

0 commit comments

Comments
 (0)