diff options
author | Blaž Hrastnik | 2021-03-22 14:23:51 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-22 14:23:51 +0000 |
commit | 3f9a94fd4364fe277f11668b0bfab4f2735c4daf (patch) | |
tree | b28862833dc3f3c5265d5ab86195ed3a2efd467f /helix-term/src/ui/markdown.rs | |
parent | d0530fb83921acc92cd51fd6fa3a8d4846ad5aec (diff) |
ui: markdown: remove trailing blank line.
Diffstat (limited to 'helix-term/src/ui/markdown.rs')
-rw-r--r-- | helix-term/src/ui/markdown.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-term/src/ui/markdown.rs b/helix-term/src/ui/markdown.rs index e41f9765..c4f6039b 100644 --- a/helix-term/src/ui/markdown.rs +++ b/helix-term/src/ui/markdown.rs @@ -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 { |