From fd999340af626f5457ecca86015175b7c237a3d0 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Tue, 6 Jul 2010 06:21:12 +0000 Subject: [PATCH] Typographics improvements --- Common/UBBParser.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Common/UBBParser.cs b/Common/UBBParser.cs index 8c67ed3..a5bcd83 100644 --- a/Common/UBBParser.cs +++ b/Common/UBBParser.cs @@ -36,7 +36,8 @@ 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] }, + { new Regex("(\\s+)--?(\\s+)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline), match => match.Groups[1] + "–" + match.Groups[2] }, + { new Regex("(\\s+)---(\\s+)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline), match => match.Groups[1] + "—" + match.Groups[2] }, }; private ITextFormatter inner;