From f3dc550c2eedd2e914944e67d76835a26a94bbb1 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 15 Feb 2025 21:07:01 +0200 Subject: [PATCH] fix new lines skip condition --- src/line/code/multiline.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/line/code/multiline.rs b/src/line/code/multiline.rs index 16e95a6..a046445 100644 --- a/src/line/code/multiline.rs +++ b/src/line/code/multiline.rs @@ -43,19 +43,16 @@ impl Multiline { return Err(Error::Completed); } + // Append to value, trim close tag on exists + self.value.push_str(line.trim_end_matches(TAG)); + // Line contain close tag if line.ends_with(TAG) { self.completed = true; - } - - // Prepend new line before next lines only - if !self.value.is_empty() { + } else { self.value.push(NEW_LINE); } - // Append to value, trim close tag on exists - self.value.push_str(line.trim_end_matches(TAG)); - Ok(()) } }