Skip to content

Commit

Permalink
Fix LT-21918: Newline symbol \0A printed in output (#216)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Naylor <[email protected]>
  • Loading branch information
jtmaxwell3 and jasonleenaylor authored Nov 25, 2024
1 parent e261e0e commit 439a403
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Src/xWorks/LcmWordGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2187,15 +2187,15 @@ internal static WP.Run CreateBeforeAfterBetweenRun(string text, string styleDisp
}
}

if (text.Contains("\\A"))
if (text.Contains("\\A") || text.Contains("\\0A") || text.Contains("\\a") || text.Contains("\\0a"))
{
var run = new WP.Run()
{
RunProperties = GenerateRunProperties(uniqueDisplayName)
};
// If the before after between text has line break characters return a composite run including the line breaks
// Use Regex.Matches to capture both the content and the delimiters
var matches = Regex.Matches(text, @"(\\A|\\0A)|[^\\]*(?:(?=\\A|\\0A)|$)");
var matches = Regex.Matches(text, @"(\\A|\\0A|\\a|\\0a)|[^\\]*(?:(?=\\A|\\0A|\\a|\\0a)|$)");
foreach (Match match in matches)
{
if (match.Groups[1].Success)
Expand Down

0 comments on commit 439a403

Please sign in to comment.