quarto-dev / quarto-dev/quarto

Pasting images in Positron visual editor breaks after 100 images

Open
#728 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug visual-editor vscode
Dominant language
TypeScript
Stars
645
Forks
62
Avg merge
17h 42m
Merged PRs (30d)
13

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the paste workflow in a Quarto document using Positron visual mode, pasting more than 100 images without renaming them. Trace the image-paste entry point and compare the handling of paste-100.png with the 101st image. Done means subsequent images retain sequential names and extensions and remain in the images/ directory; the issue names no source files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.