lampsitter / egui_commonmark

Markdown viewer for egui
Apache License 2.0
82 stars 19 forks source link

`CommonMarkViewer` adds empty veritcal space around it #54

Closed emilk closed 2 months ago

emilk commented 3 months ago

Repro

fn main() -> eframe::Result<()> {
    let mut md_cache = egui_commonmark::CommonMarkCache::default();

    eframe::run_simple_native("Markdown viewer", Default::default(), move |ctx, _frame| {
        egui::CentralPanel::default().show(ctx, |ui| {
            ui.label("Not markdown.");
            ui.label("Not markdown either.");
            let markdown = "This is markdown.";
            egui_commonmark::CommonMarkViewer::new("viewer").show(ui, &mut md_cache, markdown);
            ui.label("Not markdown again.");
            ui.label("Not markdown either.");
        });
    })
}

Result

Screenshot 2024-06-23 at 22 08 21

Expected

I would expect that CommonMarkViewer would add the normal item spacing between elements, i.e. that we would get this:

Screenshot 2024-06-23 at 22 09 27