From a81738d234a650f3f258d2b4c2402fd1f80bdb82 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Thu, 9 Sep 2010 17:42:18 +0000 Subject: [PATCH] Links appearance in UBB improved --- Builder/IISMainHandler/build.txt | 2 +- Common/BBCodes/Google.cs | 2 +- Common/BBCodes/Lurk.cs | 2 +- Common/BBCodes/RuWiki.cs | 2 +- Common/BBCodes/Wiki.cs | 2 +- Common/BBCodes/helpers/UrlProcessor.cs | 8 +++++++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 208e76a..805f574 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -1165 \ No newline at end of file +1167 \ No newline at end of file diff --git a/Common/BBCodes/Google.cs b/Common/BBCodes/Google.cs index 74fa991..1723cca 100644 --- a/Common/BBCodes/Google.cs +++ b/Common/BBCodes/Google.cs @@ -13,7 +13,7 @@ namespace FLocal.Common.BBCodes { } public override string Format(ITextFormatter formatter) { - return "" + this.GetInnerHTML(formatter) + ""; + return "g:" + this.GetInnerHTML(formatter) + ""; } } diff --git a/Common/BBCodes/Lurk.cs b/Common/BBCodes/Lurk.cs index 92683d8..00beee9 100644 --- a/Common/BBCodes/Lurk.cs +++ b/Common/BBCodes/Lurk.cs @@ -13,7 +13,7 @@ namespace FLocal.Common.BBCodes { } public override string Format(ITextFormatter formatter) { - return "" + this.GetInnerHTML(formatter) + ""; + return "l:" + this.GetInnerHTML(formatter) + ""; } } diff --git a/Common/BBCodes/RuWiki.cs b/Common/BBCodes/RuWiki.cs index 62d5deb..18dd2f4 100644 --- a/Common/BBCodes/RuWiki.cs +++ b/Common/BBCodes/RuWiki.cs @@ -13,7 +13,7 @@ namespace FLocal.Common.BBCodes { } public override string Format(ITextFormatter formatter) { - return "" + this.GetInnerHTML(formatter) + ""; + return "в:" + this.GetInnerHTML(formatter) + ""; } } diff --git a/Common/BBCodes/Wiki.cs b/Common/BBCodes/Wiki.cs index 867060c..d3ad772 100644 --- a/Common/BBCodes/Wiki.cs +++ b/Common/BBCodes/Wiki.cs @@ -13,7 +13,7 @@ namespace FLocal.Common.BBCodes { } public override string Format(ITextFormatter formatter) { - return "" + this.GetInnerHTML(formatter) + ""; + return "w:" + this.GetInnerHTML(formatter) + ""; } } diff --git a/Common/BBCodes/helpers/UrlProcessor.cs b/Common/BBCodes/helpers/UrlProcessor.cs index 35ffcac..23d04f9 100644 --- a/Common/BBCodes/helpers/UrlProcessor.cs +++ b/Common/BBCodes/helpers/UrlProcessor.cs @@ -57,15 +57,21 @@ namespace FLocal.Common.BBCodes { if(title == null) { title = link; } + bool isExternal = true; string url; if(shortenRelative) { var urlInfo = UrlProcessor.Process(link); url = urlInfo.relativeUrl; + isExternal = !urlInfo.isLocal; } else { var urlInfo = new Uri(link); url = urlInfo.ToString(); } - return "" + title + ""; + string result = "" + title + ""; + if(isExternal) { + result += ""; + } + return result; } }