Skip to content

Live Preview: rendered images have excessive vertical spacingΒ #261

Closed

Description

@beini-faxianl

Would it be possible to reduce the extra vertical padding around rendered images in Live Preview mode? I'd really appreciate any improvements here β€” thanks for all your work on this project! 😊

Description

When Live Preview is enabled, rendered images appear with excessive vertical spacing above and below the image. The image block takes up significantly more vertical space than the actual image content, making the editor feel less compact than typical Markdown preview rendering.

Image Image Image Image

Expected Behavior

Image

Activity

  1. adibhanna commented on Jun 25, 2026

    @adibhanna
    Contributor

    Fixed for the upcoming v2.8.0 πŸŽ‰

    Root cause: in Live Preview a rendered image is an inline widget anchored at end-of-line (with the raw ![alt](src) source hidden). Even though the figure renders as a block, the host editor line still reserved a full text line-box β€” roughly one line-height of empty space above and below the image. That phantom row, on top of the figure's margins, was the excessive gap (most noticeable beneath the image).

    Fix: the image line now collapses that strut to zero only while its source is hidden, plus a small trim to the figure margins. The spacing is tight and balanced, and below-image space dropped ~76% in my measurements. Scoped to the editor, so reading/Preview mode is unchanged β€” and clicking onto the image to edit its markdown reveals the raw source at full, readable line-height exactly as before.

    Shipping in v2.8.0 (#269), commit 33ab105. Thanks for the report! πŸ™

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions