Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Preserve images when pasting HTML content#1677

Open
T9knauf wants to merge 1 commit into
BoostIO:masterfrom
T9knauf:fix-html-image-paste-922
Open

Preserve images when pasting HTML content#1677
T9knauf wants to merge 1 commit into
BoostIO:masterfrom
T9knauf:fix-html-image-paste-922

Conversation

@T9knauf
Copy link
Copy Markdown

@T9knauf T9knauf commented May 10, 2026

Closes #922

IssueHunt bounty: https://issuehunt.io/repos/74213528/issues/922

This adds focused HTML clipboard conversion when pasted content includes images. Existing file paste/upload handling still runs first, and HTML fragments without images continue through CodeMirror's normal paste behavior.

For pasted web content containing <img> tags, the handler converts the clipboard HTML to Markdown and preserves image URLs as Markdown image links instead of trying to download remote assets, matching the maintainer guidance in #922.

Test plan:

  • ./node_modules/.bin/jest -c jest.json --runInBand src/cloud/lib/editor/htmlToMarkdown.spec.ts
  • ./node_modules/.bin/eslint src/cloud/lib/editor/htmlToMarkdown.ts src/cloud/lib/editor/htmlToMarkdown.spec.ts src/cloud/lib/editor/plugins/fileHandler.ts --ext .ts,.tsx
  • ./node_modules/.bin/tsc --noEmit --pretty false
  • git diff --check

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can not paste web page with images

2 participants