Links parsing improved

main
Inga 🏳‍🌈 14 years ago
parent 11c7ae5012
commit b1263301ea
  1. 2
      Builder/IISMainHandler/build.txt
  2. 9
      Common/BBCodes/helpers/UrlProcessor.cs
  3. 6
      static/css/modern/global.css

@ -71,7 +71,7 @@ namespace FLocal.Common.BBCodes {
} }
if(isExternal) { if(isExternal) {
if(title == null) { if(title == null) {
title = url; title = Safe(url);
} }
} else { } else {
var linkInfo = URL.UrlManager.Parse(url, new System.Collections.Specialized.NameValueCollection(), true); var linkInfo = URL.UrlManager.Parse(url, new System.Collections.Specialized.NameValueCollection(), true);
@ -80,13 +80,10 @@ namespace FLocal.Common.BBCodes {
} }
url = linkInfo.canonicalFull; url = linkInfo.canonicalFull;
if(title == null) { if(title == null) {
title = linkInfo.title; title = Safe(linkInfo.title);
} }
} }
string result = "<a href=\"" + url + "\">" + Safe(title) + "</a>"; string result = String.Format("<a href=\"{0}\"{1}>{2}</a>", url, (isExternal ? " class=\"external\"" : ""), title);
if(isExternal) {
result += "<img src=\"/static/images/external.png\" border=\"0\"/>";
}
return result; return result;
} }

@ -167,3 +167,9 @@ BLOCKQUOTE BR {FONT-SIZE:1px}
font-size:0.8em; font-size:0.8em;
width:16.25em; width:16.25em;
} }
a.external {
padding-right:13px;
background-image:url(/static/images/external.png);
background-repeat:no-repeat;
background-position:right center;
}

Loading…
Cancel
Save