on master help sign in
ui: markdown: remove trailing blank line.
commit3f9a94fd4364fe277f11668b0bfab4f2735c4daf authorBlaž Hrastnik <blaz@mxxn.io> dateMon 22 Mar 2021, 23:23 (6 years ago) parentd0530fb
1 file changed+7
helix-term/src/ui/markdown.rs+7
helix-term/src/ui/markdown.rs+7
@@ -174,6 +174,13 @@ fn parse<'a>(contents: &'a str, theme: Option<&Theme>) -> tui::text::Text<'a> {
174174 lines.push(Spans::from(spans));
175175 }
176176
177+ // if last line is empty, remove it
178+ if let Some(line) = lines.last() {
179+ if line.0.is_empty() {
180+ lines.pop();
181+ }
182+ }
183+
177184 Text::from(lines)
178185}
179186impl Component for Markdown {