forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render email addresses as such if followed by punctuation (go-gitea#2…
…7987) Added the following characters to the regular expression for the email: - , - ; - ? - ! Also added a test case. - Fixes go-gitea#27616 # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/c57eac26-f281-43ef-a51d-9c9a81b63efa) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/fc7d5c08-4350-4af0-a7f0-d1444d2d75af) Signed-off-by: Yarden Shoham <[email protected]>
- Loading branch information
1 parent
2d13e63
commit 2120fbb
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -264,6 +264,18 @@ func TestRender_email(t *testing.T) { | |
"send email to [email protected].", | ||
`<p>send email to <a href="mailto:[email protected]" rel="nofollow">[email protected]</a>.</p>`) | ||
|
||
test( | ||
`[email protected], | ||
[email protected]. | ||
[email protected]; | ||
[email protected]? | ||
[email protected]!`, | ||
`<p><a href="mailto:[email protected]" rel="nofollow">[email protected]</a>,<br/> | ||
<a href="mailto:[email protected]" rel="nofollow">[email protected]</a>.<br/> | ||
<a href="mailto:[email protected]" rel="nofollow">[email protected]</a>;<br/> | ||
<a href="mailto:[email protected]" rel="nofollow">[email protected]</a>?<br/> | ||
<a href="mailto:[email protected]" rel="nofollow">[email protected]</a>!</p>`) | ||
|
||
// Test that should *not* be turned into email links | ||
test( | ||
"\"[email protected]\"", | ||
|