Skip to content

CommonMarkViewer adds empty veritcal space around it #54

@emilk

Description

@emilk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions