File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,12 @@ func TestRender_links(t *testing.T) {
204
204
test (
205
205
"magnet:?xt=urn:btih:5dee65101db281ac9c46344cd6b175cdcadabcde&dn=download" ,
206
206
`<p><a href="magnet:?xt=urn:btih:5dee65101db281ac9c46344cd6b175cdcadabcde&dn=download" rel="nofollow">magnet:?xt=urn:btih:5dee65101db281ac9c46344cd6b175cdcadabcde&dn=download</a></p>` )
207
+ test (
208
+ `[link](https://example.com)` ,
209
+ `<p><a href="https://example.com" rel="nofollow">link</a></p>` )
210
+ test (
211
+ `[link](mailto:test@example.com)` ,
212
+ `<p><a href="mailto:test@example.com" rel="nofollow">link</a></p>` )
207
213
208
214
// Test that should *not* be turned into URL
209
215
test (
@@ -673,3 +679,9 @@ func TestIssue18471(t *testing.T) {
673
679
assert .NoError (t , err )
674
680
assert .Equal (t , "<a href=\" http://domain/org/repo/compare/783b039...da951ce\" class=\" compare\" ><code class=\" nohighlight\" >783b039...da951ce</code></a>" , res .String ())
675
681
}
682
+
683
+ func TestIsFullURL (t * testing.T ) {
684
+ assert .True (t , markup .IsFullURLString ("https://example.com" ))
685
+ assert .True (t , markup .IsFullURLString ("mailto:test@example.com" ))
686
+ assert .False (t , markup .IsFullURLString ("/foo:bar" ))
687
+ }
You can’t perform that action at this time.
0 commit comments