C2021-045 add BeforeList ReplaceWords flag
C2021-045 add logic to support BeforeList ReplaceWords flag
This commit is contained in:
@@ -2051,6 +2051,8 @@ namespace VEPROMS.CSLA.Library
|
||||
foreach (FormatConfig.ReplaceStr rs in rsl)
|
||||
{
|
||||
bool dopartial = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.Partials) == E_ReplaceFlags.Partials;
|
||||
bool onlyDoList = (E_ReplaceFlags)(rs.Flag & FormatConfig.E_ReplaceFlagsUCF.BeforeList) == E_ReplaceFlags.BeforeList; // C2021-045
|
||||
|
||||
// note that the order of this check is important. Check in this order...
|
||||
// background here
|
||||
if (!shouldReplace.ContainsKey((E_ReplaceFlags)rs.Flag))
|
||||
@@ -2060,7 +2062,11 @@ namespace VEPROMS.CSLA.Library
|
||||
//ProfileTimer.Pop(profileDepth2);
|
||||
}
|
||||
bool replaceit = shouldReplace[(E_ReplaceFlags)rs.Flag];
|
||||
|
||||
|
||||
// C2021-045 if the BeforeList ReplaceWords flag is set, only do the replace word if the text ends with a colon
|
||||
if (replaceit && onlyDoList && !Text.EndsWith(":"))
|
||||
replaceit = false; // text does not end with a colon so don't replace this word
|
||||
|
||||
if (replaceit)
|
||||
{
|
||||
if (!dicReplaceRegex.ContainsKey(rs))
|
||||
|
Reference in New Issue
Block a user