mirror of
https://github.com/YGGverse/ggemtext.git
synced 2026-03-31 17:15:33 +00:00
fix new lines skip condition
This commit is contained in:
parent
e1cb4f9b99
commit
f3dc550c2e
1 changed files with 4 additions and 7 deletions
|
|
@ -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(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue