Skip to content

Pasting images in Positron visual editor breaks after 100 images #728

Open
@jonpeake

Description

@jonpeake

Bug description

I've encountered a potential bug where pasting images from the clipboard into a markdown or Quarto document when in visual mode breaks after the 100th image if images are not renamed post-paste. When pasting an image the image file is copied to the images folder in the directory where the document resides. By default, it's assigned a sequential file name paste-#.png. After the 100th file is pasted in (i.e., paste-1.png through paste-100.png all exist) and no files are renamed, the Quarto extension can no longer assign file names to pasted images, and instead the files are assigned the name paste-[random string of characters] with no image extension and located in the main directory, not the images/ directory. You can manually add a .png to the file name and it will render properly, otherwise the image is not rendered properly when the quarto file is rendered.

This issue is compounded by the fact that multiple copies of the same image add new files to the file list. In RStudio, for example, Quarto points to the same file in the images/ folder if additional copies of the file are pasted in the document.

Steps to reproduce

Paste >100 images into a quarto document in Positron visual mode.

Actual behavior

Observe that the 101st image on saves as paste-[random character string] and saves outside of the images/ directory
Image

Expected behavior

Images should continue to sequentially increase, save with the proper extension, and be saved to the proper directory.

Your environment

  • IDE: Positron 2025.07.0 build 80
  • OS: Windows_NT x64 10.0.22631

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions