diff --git a/Terminal.Gui/Text/TextFormatter.cs b/Terminal.Gui/Text/TextFormatter.cs index d29b855b2..5748ae0fb 100644 --- a/Terminal.Gui/Text/TextFormatter.cs +++ b/Terminal.Gui/Text/TextFormatter.cs @@ -579,7 +579,7 @@ public class TextFormatter /// public List GetLines () { - string text = _text!; + string text = _text!.ReplaceLineEndings (); // With this check, we protect against subclasses with overrides of Text if (string.IsNullOrEmpty (Text) || ConstrainToWidth is 0 || ConstrainToHeight is 0) diff --git a/UICatalog/UICatalog.cs b/UICatalog/UICatalog.cs index 5433cad30..1cfeba1fb 100644 --- a/UICatalog/UICatalog.cs +++ b/UICatalog/UICatalog.cs @@ -79,21 +79,24 @@ public class UICatalogApp /// public static string GetAboutBoxMessage () { - // NOTE: Do not use verbatim string here. + // NOTE: Do not use multiline verbatim strings here. // WSL gets all confused. StringBuilder msg = new (); msg.AppendLine ("UI Catalog: A comprehensive sample library for"); msg.AppendLine (); - msg.AppendLine (@" _______ _ _ _____ _"); - msg.AppendLine (@"|__ __| (_) | | / ____| (_)"); - msg.AppendLine (@" | | ___ _ __ _ __ ___ _ _ __ __ _| || | __ _ _ _"); - msg.AppendLine (@" | |/ _ \ '__| '_ ` _ \| | '_ \ / _` | || | |_ | | | | |"); - msg.AppendLine (@" | | __/ | | | | | | | | | | | (_| | || |__| | |_| | |"); - msg.AppendLine (@" |_|\___|_| |_| |_| |_|_|_| |_|\__,_|_(_)_____|\__,_|_|"); + + msg.AppendLine (""" + _______ _ _ _____ _ + |__ __| (_) | | / ____| (_) + | | ___ _ __ _ __ ___ _ _ __ __ _| || | __ _ _ _ + | |/ _ \ '__| '_ ` _ \| | '_ \ / _` | || | |_ | | | | | + | | __/ | | | | | | | | | | | (_| | || |__| | |_| | | + |_|\___|_| |_| |_| |_|_|_| |_|\__,_|_(_)_____|\__,_|_| + """); msg.AppendLine (); - msg.AppendLine (@"v2 - Pre-Alpha"); + msg.AppendLine ("v2 - Pre-Alpha"); msg.AppendLine (); - msg.AppendLine (@"https://github.com/gui-cs/Terminal.Gui"); + msg.AppendLine ("https://github.com/gui-cs/Terminal.Gui"); return msg.ToString (); } diff --git a/UnitTests/Text/TextFormatterTests.cs b/UnitTests/Text/TextFormatterTests.cs index 3e55df4a7..c3073ba6e 100644 --- a/UnitTests/Text/TextFormatterTests.cs +++ b/UnitTests/Text/TextFormatterTests.cs @@ -7219,9 +7219,9 @@ B ")] string expectedText = """ ******UI Catalog: A comprehensive sample library for****** ********************************************************** - _______ _ _ _____ _* + _______ _ _ _____ _ |__ __| (_) | | / ____| (_) - | | ___ _ __ _ __ ___ _ _ __ __ _| || | __ _ _ _* + | | ___ _ __ _ __ ___ _ _ __ __ _| || | __ _ _ _ | |/ _ \ '__| '_ ` _ \| | '_ \ / _` | || | |_ | | | | | | | __/ | | | | | | | | | | | (_| | || |__| | |_| | | |_|\___|_| |_| |_| |_|_|_| |_|\__,_|_(_)_____|\__,_|_| @@ -7232,7 +7232,7 @@ B ")] ********************************************************** """; - TestHelpers.AssertDriverContentsAre (expectedText, _output); + TestHelpers.AssertDriverContentsAre (expectedText.ReplaceLineEndings (), _output); } }