mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-11-11 14:34:31 +03:00
ui: markdown: remove trailing blank line.
This commit is contained in:
parent
d0530fb839
commit
3f9a94fd43
@ -174,6 +174,13 @@ fn parse<'a>(contents: &'a str, theme: Option<&Theme>) -> tui::text::Text<'a> {
|
||||
lines.push(Spans::from(spans));
|
||||
}
|
||||
|
||||
// if last line is empty, remove it
|
||||
if let Some(line) = lines.last() {
|
||||
if line.0.is_empty() {
|
||||
lines.pop();
|
||||
}
|
||||
}
|
||||
|
||||
Text::from(lines)
|
||||
}
|
||||
impl Component for Markdown {
|
||||
|
Loading…
Reference in New Issue
Block a user