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(()) } }