Skip to content

Feature request: width & height attributes for images in Markdown #1010

Done

Description

@johnfraney

I noticed that images in Markdown don't have width/height attributes, which leads to a layout shift for Markdown pages that contain images.

Would it be possible to add support (opt-in?) for this? It will require reading image files during Markdown rendering, which could be a bit slow, but it would be a good stopgap until something like #441 is available.

Activity

  1. hyfdev commented on Dec 3, 2026

    @hyfdev
    Contributor

    You can already set them with attributes after the image:

    ![Photo](/photo.png){width=640 height=360}

    The Markdown guide only shows attributes on headings and paragraphs, so I added an image example in #1021.

    Reading the sizes automatically would work for images in public/ as an opt-in. Would that cover your case?

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

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions