From 707401837f99479021574c5cdfca01e6e00b0a74 Mon Sep 17 00:00:00 2001 From: Erlend Walstad <96946613+lampsitter@users.noreply.github.com> Date: Tue, 2 Apr 2024 22:50:11 +0200 Subject: [PATCH] Fix newline before alert --- src/parsers/pulldown.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/parsers/pulldown.rs b/src/parsers/pulldown.rs index 3a3735e..dc6698f 100644 --- a/src/parsers/pulldown.rs +++ b/src/parsers/pulldown.rs @@ -430,6 +430,10 @@ impl CommonMarkViewerInternal { if self.is_blockquote { let mut collected_events = delayed_events(events, pulldown_cmark::TagEnd::BlockQuote); + if self.should_insert_newline { + newline(ui) + } + if let Some(alert) = parse_alerts(&options.alerts, &mut collected_events) { alert.ui(ui, |ui| { for (event, src_span) in collected_events.into_iter() { @@ -437,9 +441,6 @@ impl CommonMarkViewerInternal { } }) } else { - if self.should_insert_newline { - newline(ui) - } blockquote(ui, ui.visuals().weak_text_color(), |ui| { self.text_style.quote = true; for (event, src_span) in collected_events {