From 24aa9552c907388973e43cfc552626bc7dc96cae Mon Sep 17 00:00:00 2001 From: John Maxwell Date: Mon, 25 Nov 2024 09:10:24 -0800 Subject: [PATCH] Fix LT-21918: Newline symbol \0A printed in output --- Src/xWorks/LcmWordGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/xWorks/LcmWordGenerator.cs b/Src/xWorks/LcmWordGenerator.cs index cec10d4303..6a760f7ecb 100644 --- a/Src/xWorks/LcmWordGenerator.cs +++ b/Src/xWorks/LcmWordGenerator.cs @@ -2160,7 +2160,7 @@ 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() { @@ -2168,7 +2168,7 @@ internal static WP.Run CreateBeforeAfterBetweenRun(string text, string styleDisp }; // 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)