Skip to content

feature: Support for image dimensions syntax (e.g. =x300) in image links #559

@yihao03

Description

@yihao03

Is your feature request related to a problem? Please describe.

Description

I use markdown syntax that includes image dimensions, which is common in Pandoc or specific markdown flavors (e.g., ![alt](path.png =x300)).

When this syntax is used, render-markdown.nvim fails to correctly identify the line as an image. Instead of concealing the URL and showing the image icon/name (as it does for standard images), it displays the raw content inside the parentheses.

To Reproduce

  1. Create a markdown file.
  2. Add an image with standard syntax: ![test](image.png).
    • Observation: It renders correctly (e.g., shows the image icon and "test").
  3. Add an image with dimensions: ![test](image.png =x300).

Expected Behavior

The plugin should recognize the pattern as a valid image link and render the image icon/label, concealing the path and dimension parameters.

Actual Behavior

The rendering does not trigger for the image link, and the full raw text (image.png =x300) is displayed.

Example:

Image

Expected behaviour

Image

Describe the solution you'd like

Render image with dimensions without the content in the raw parentheses

Describe alternatives you've considered

format the size nicely (omit then path but keeps the size)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions