on master help sign in
ui: markdown: remove trailing blank line.
3f9a94fBlaž Hrastnik
helix-term/src/ui/markdown.rs+7
@@ -174,6 +174,13 @@ fn parse<'a>(contents: &'a str, theme: Option<&Theme>) -> tui::text::Text<'a> {
174 lines.push(Spans::from(spans));
174 lines.push(Spans::from(spans));
175 }
175 }
176
176
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+
177 Text::from(lines)
184 Text::from(lines)
178}
185}
179impl Component for Markdown {
186impl Component for Markdown {