Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixes copy/paste of images from browsers like Google Chrome#1000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@Rohland
Copy link

@RohlandRohland commentedOct 20, 2022
edited
Loading

The Bug

Assume two users, A and B, are collaborating.

User A uses their Google Chrome browser to copy an image (right clicks on an image > Copy Image) and pastes it into Trix. The source of the image is a private application that only A has access to (i.e. the image path is protected by authentication).

User A can see their image is successfully rendered in Trix, and happily saves their changes.

User B logs in to contribute to the content. They fire up Trix.

The image pasted by User A cannot be displayed (since User B does not have access to the path).

Why is this a bug?

When User A pasted into Trix, the clipboard data contains both the image URL/markup + actual file.

Seehttps://input-inspector.javan.us/profiles/r1s8c7DqbOQXXjz76mj0 for an example.

So, there are two items in the clipboard, however, Trix doesn't treat the paste as a file, but rather markup. This is because of existing code that tries to work around a Microsoft Office quirk, that includes an image of the copied text when content is copied from Word etc.

The Proposed Fix

Without inspecting the content to deal with the MS Word issue (we could search forMsoNormal), we simply invoke the existing logic if there are 3 (or more) types, i.e.text/html,text/plain and a file. If there are only two types, i.e.text/html and file, we should be good (hopefully!).

@RohlandRohland changed the titleFix image copy/paste from browsers like Google ChromeFixes copy/paste of images from browsers like Google ChromeOct 20, 2022
@Nitrodist
Copy link

Oh hello, creator of Trix while at Basecamp, et al.! Thank you for the PR.

@jeremy
Copy link
Member

Ported to ES6 in#1081.

@jeremyjeremy closed thisSep 12, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@Rohland@Nitrodist@jeremy

[8]ページ先頭

©2009-2025 Movatter.jp