mirror of
https://github.com/YGGverse/ggemtext.git
synced 2026-03-31 09:05:32 +00:00
prepend new line before next lines only
This commit is contained in:
parent
dbe080a4f1
commit
7d6c049870
1 changed files with 7 additions and 4 deletions
|
|
@ -38,16 +38,19 @@ 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;
|
||||
} else {
|
||||
}
|
||||
|
||||
// Prepend new line before next lines only
|
||||
if !self.value.is_empty() {
|
||||
self.value.push(NEW_LINE);
|
||||
}
|
||||
|
||||
// Append to value, trim close tag on exists
|
||||
self.value.push_str(line.trim_end_matches(TAG));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue