From 3532b41bceeb02faf49b2d7e80153cb55660399b Mon Sep 17 00:00:00 2001 From: Sajid Date: Sat, 30 Sep 2023 01:44:16 +0600 Subject: [PATCH] Fix multiline code description parsing --- .../Libraries/HedgeModManager.CodeCompiler/CSharpCode.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Libraries/HedgeModManager.CodeCompiler/CSharpCode.cs b/Source/Libraries/HedgeModManager.CodeCompiler/CSharpCode.cs index 05aa79c..88fd649 100644 --- a/Source/Libraries/HedgeModManager.CodeCompiler/CSharpCode.cs +++ b/Source/Libraries/HedgeModManager.CodeCompiler/CSharpCode.cs @@ -114,12 +114,12 @@ public static List Parse(StreamReader reader) // Parse description of the last code if (currentCode != null) { + currentCode.Body = lineBuilder.ToString().TrimEnd('\r', '\n'); + if (isMultilineDescription) { currentCode.Description = DescriptionFromBody(currentCode); } - - currentCode.Body = lineBuilder.ToString().TrimEnd('\r', '\n'); } lineBuilder.Clear(); @@ -175,12 +175,12 @@ the description will be on the next line. */ // Parse the last one if (currentCode != null) { + currentCode.Body = lineBuilder.ToString().TrimEnd('\r', '\n'); + if (isMultilineDescription) { currentCode.Description = DescriptionFromBody(currentCode); } - - currentCode.Body = lineBuilder.ToString().TrimEnd('\r', '\n'); } }