mirror of https://bitbucket.org/anguist/ntpa
Fix bug in absolute URLs
This commit is contained in:
parent
8c0bc13a35
commit
938c24765e
|
@ -396,6 +396,16 @@ protected Uri CheckLink(string link, string keyword)
|
|||
return null;
|
||||
|
||||
Uri uri;
|
||||
string text = link.TrimStart();
|
||||
|
||||
if ((text.StartsWith("http://") ||
|
||||
text.StartsWith("https://") ||
|
||||
text.StartsWith("ftp://") ||
|
||||
text.StartsWith("maito:") ||
|
||||
text.StartsWith("javascript:")) &&
|
||||
Uri.TryCreate(link, UriKind.Absolute, out uri))
|
||||
return uri;
|
||||
|
||||
if (Uri.TryCreate("/" + link.TrimStart('/'), UriKind.Relative, out uri))
|
||||
return uri;
|
||||
|
||||
|
|
Loading…
Reference in New Issue