From bbf567cdc322adba2a5dfdb18ef619ac5a4e81a9 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Tue, 6 Jul 2010 13:57:21 +0000 Subject: [PATCH] Fixed smileys parsing --- Common/UBBParser.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/UBBParser.cs b/Common/UBBParser.cs index a5bcd83..7f4e11a 100644 --- a/Common/UBBParser.cs +++ b/Common/UBBParser.cs @@ -33,7 +33,7 @@ namespace FLocal.Common { { ":lol:", "lol" }, }; - private static readonly Dictionary SMILEYS_DATA = (from smile in SMILEYS select new KeyValuePair(new Regex("(^|\\s+|>)" + Regex.Escape(smile.Key) + "($|\\s+|<)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline), match => match.Groups[1] + "\""" + match.Groups[2])).ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + private static readonly Dictionary SMILEYS_DATA = (from smile in SMILEYS select new KeyValuePair(new Regex("(^|\\s|>)" + Regex.Escape(smile.Key) + "($|\\s|<)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline), match => match.Groups[1] + "\""" + match.Groups[2])).ToDictionary(kvp => kvp.Key, kvp => kvp.Value); private static readonly Dictionary TYPOGRAPHICS = new Dictionary { { new Regex("(\\s+)--?(\\s+)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline), match => match.Groups[1] + "–" + match.Groups[2] }, @@ -47,7 +47,7 @@ namespace FLocal.Common { } public string Format(string source) { - string result = this.inner.Format(source); + string result = this.inner.Format(source).Replace(" ", " "); foreach(var smile in SMILEYS_DATA) { result = smile.Key.Replace(result, smile.Value); }