Added admin tool to fix hyphens

Fix hyphens when non-standard hyphens are pasted
This commit is contained in:
Rich
2017-06-26 15:19:47 +00:00
parent ee10dbde82
commit 850acf34b4
3 changed files with 72 additions and 1 deletions

View File

@@ -798,9 +798,14 @@ namespace VEPROMS.CSLA.Library
}
#endregion
#region SaveData
/// <summary>
/// B2017-121 Regular Express for all RTF tokens for Hyphens
/// </summary>
private static Regex regHyphen = new Regex(@"(?<!\\)(\\u8208\?|\\u8210\?|\\u8211\?|\\u8212\?|\\u8213\?|\\_|\\endash|\\emdash|-)");
public bool Save(RichTextBox rtb)
{
string rtbString = RtfToDbText(rtb.Rtf).Replace("<BackSlash>", "\\\\");
// B2017-121 Replace all types of hyphens with non-breaking hyphens
string rtbString = regHyphen.Replace( RtfToDbText(rtb.Rtf).Replace("<BackSlash>", "\\\\"),@"\u8209?");
return Save(rtbString);
}
public bool Save(string modtext)