Fixes a null reference usage
This commit is contained in:
parent
e4ee206c34
commit
1dea649d4a
1 changed files with 14 additions and 1 deletions
|
|
@ -39,7 +39,7 @@ namespace Yavsc.Helpers
|
|||
}
|
||||
public string Execute(string source)
|
||||
{
|
||||
return source.Replace(target, replacement);
|
||||
return source?.Replace(target, replacement) ?? null;
|
||||
}
|
||||
}
|
||||
public static class TeXHelpers
|
||||
|
|
@ -79,6 +79,19 @@ namespace Yavsc.Helpers
|
|||
}
|
||||
return new TeXString(result);
|
||||
}
|
||||
|
||||
public static TeXString ToTeXCell(this string source)
|
||||
{
|
||||
string result=source;
|
||||
foreach (var r in SpecialCharsDefaultRendering)
|
||||
{
|
||||
result = r.Execute(result);
|
||||
}
|
||||
result = result.Replace("\n","\\tabularnewline ");
|
||||
return new TeXString(result);
|
||||
}
|
||||
|
||||
|
||||
public static string NewLinesWith(this string target, string separator)
|
||||
{
|
||||
var items = target.Split(new char[] { '\n' }).Where(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue