mirror of
https://github.com/YGGverse/ggemtext.git
synced 2026-03-31 09:05:32 +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);
|
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
|
// Line contain close tag
|
||||||
if line.ends_with(TAG) {
|
if line.ends_with(TAG) {
|
||||||
self.completed = true;
|
self.completed = true;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// Prepend new line before next lines only
|
|
||||||
if !self.value.is_empty() {
|
|
||||||
self.value.push(NEW_LINE);
|
self.value.push(NEW_LINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append to value, trim close tag on exists
|
|
||||||
self.value.push_str(line.trim_end_matches(TAG));
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue