C2021-061 don’t process replace words if they are delimited with “()” or “,’ (quotes from 11/3/21)

This commit is contained in:
Kathy Ruffing 2021-11-16 13:50:28 +00:00
parent d8983d41d6
commit b92bdb3466
4 changed files with 14 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -2123,8 +2123,8 @@ namespace VEPROMS.CSLA.Library
string wordMatchEnd = Regex.IsMatch(replaceWord.Substring(replaceWord.Length - 1, 1), @"\W") ? "" : @"(?=\W|$)";
string pat = wordMatchBeg + @"(?<!\\u160\?|\\u8209\?|\\b|\-)" + replaceWord + @"(?!\\u160\?|\\u8209\?|\-)" + wordMatchEnd;
// C2021-061: For Barakah don't do replace if word is surrounded by " or ', i.e. they are no longer delimiters
if (_MyItemInfo != null && _MyItemInfo.ActiveFormat != null && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.NoReplaceQuoteWords)
pat = wordMatchBeg + @"(?<!\\u160\?|\\u8209\?|\\b|\-|""|')" + replaceWord + @"(?!\\u160\?|\\u8209\?|\-|""|')" + wordMatchEnd;
if (_MyItemInfo != null && _MyItemInfo.ActiveFormat != null && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.NoReplaceQuoteParenWords)
pat = wordMatchBeg + @"(?<!\\u160\?|\\u8209\?|\\b|\-|""|'|\()" + replaceWord + @"(?!\\u160\?|\\u8209\?|\-|""|'|\))" + wordMatchEnd;
dicReplaceRegex.Add(rs, new Regex(pat, myOptions));
//ProfileTimer.Pop(profileDepth3);
}

View File

@ -1683,6 +1683,14 @@ namespace VEPROMS.CSLA.Library
return LazyLoad(ref _height, "@height");
}
}
private LazyLoad<string> _hasAppl;
public string hasAppl
{
get
{
return LazyLoad(ref _hasAppl, "@hasAppl");
}
}
}
#endregion
#region SIAll
@ -2443,12 +2451,13 @@ namespace VEPROMS.CSLA.Library
}
}
// C2021-061: For Barakah don't do replace if word is surrounded by " or '
private LazyLoad<bool> _NoReplaceQuoteWords;
public bool NoReplaceQuoteWords
// Initial fix was 11/3/21. Added parens do the quotes on 11/16/21
private LazyLoad<bool> _NoReplaceQuoteParenWords;
public bool NoReplaceQuoteParenWords
{
get
{
return LazyLoad(ref _NoReplaceQuoteWords, "@NoReplaceQuoteWords");
return LazyLoad(ref _NoReplaceQuoteParenWords, "@NoReplaceQuoteParenWords");
}
}
private LazyLoad<bool> _UseMetaSections;