From b7b90d31dff9e50c7ba9a1bb423d959f8bed1111 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Mon, 5 Jul 2010 00:18:48 +0000 Subject: [PATCH] Typographics initial commit --- Builder/IISMainHandler/build.txt | 2 +- Builder/IISUploadHandler/build.txt | 2 +- Common/UBBParser.cs | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 23c5f49..6838ebe 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -572 \ No newline at end of file +574 \ No newline at end of file diff --git a/Builder/IISUploadHandler/build.txt b/Builder/IISUploadHandler/build.txt index 0e92c3c..4d85316 100644 --- a/Builder/IISUploadHandler/build.txt +++ b/Builder/IISUploadHandler/build.txt @@ -1 +1 @@ -306 \ No newline at end of file +308 \ No newline at end of file diff --git a/Common/UBBParser.cs b/Common/UBBParser.cs index 7fd8b8f..8c67ed3 100644 --- a/Common/UBBParser.cs +++ b/Common/UBBParser.cs @@ -35,6 +35,10 @@ namespace FLocal.Common { 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] }, + }; + private ITextFormatter inner; private TextFormatter() { @@ -46,6 +50,9 @@ namespace FLocal.Common { foreach(var smile in SMILEYS_DATA) { result = smile.Key.Replace(result, smile.Value); } + foreach(var kvp in TYPOGRAPHICS) { + result = kvp.Key.Replace(result, kvp.Value); + } return result; }