B2019-037 added logic to replace ~ and # characters with superscript and subscript commands

This commit is contained in:
2019-04-17 17:06:37 +00:00
parent b970920ee5
commit 70692e9d77
4 changed files with 14 additions and 7 deletions

View File

@@ -216,11 +216,18 @@ namespace VEPROMS.CSLA.Library
// return null;
//}
public string GetTranslatedRoValue(string ROID16, bool DoCaret)
public string GetTranslatedRoValue(string ROID16, bool DoCaret, bool DoDOSSuperSubScript)
{
string retval = GetRoValue(ROID16);
retval = ReplaceUnicode(retval, DoCaret);
retval = ConvertFortranFormatToScienctificNotation(retval);
// B2019-037 handle the super an sub scripts after getting the RO value from the FST
// the corrected RO text is added to the display text in the link info
if (DoDOSSuperSubScript)
{
retval = Regex.Replace(retval, "[#](.*?)[#]", "\\up2 $1\\up0 ");// Superscript
retval = Regex.Replace(retval, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// Subscript
}
return retval.Replace("\r\n", @"\par ");
}
private string ReplaceUnicode(string s2, bool DoCaret)