Skip to content

Commit

Permalink
Provide workaround for #192 (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
Happypig375 authored May 5, 2021
1 parent a7e11ba commit 69fb790
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CSharpMath.Rendering/Text/TextLaTeXParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ string BreakText(string text, string seperator = "|")
}
BreakText(@"Here are some text $1 + 12 \frac23 \sqrt4$ $$Display$$ text")
*/
/// <summary>Handle additional languages</summary>
public static List<BreakingEngine> AdditionalBreakingEngines { get; } = new();
public static Result<TextAtom> TextAtomFromLaTeX(string latexSource) {
if (string.IsNullOrEmpty(latexSource))
return new TextAtom.List(Array.Empty<TextAtom>());
Expand All @@ -54,6 +56,8 @@ public static Result<TextAtom> TextAtomFromLaTeX(string latexSource) {
BreakNumberAfterText = true,
ThrowIfCharOutOfRange = false
};
foreach (var engine in AdditionalBreakingEngines)
breaker.AddBreakingEngine(engine);
breaker.BreakWords(latexSource);

Result CheckDollarCount(int startAt, ref int endAt, TextAtomListBuilder atoms) {
Expand Down

0 comments on commit 69fb790

Please sign in to comment.