Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-upload images referenced by markdown as an easy CLI way to inline 'em #437

Open
matrixbot opened this issue Nov 29, 2015 · 7 comments
Labels
A-Composer A-File-Upload Attachments and file uploads O-Occasional Affects or can be seen by some users regularly or most users rarely S-Tolerable Low/no impact on users T-Enhancement

Comments

@matrixbot
Copy link

Created by @ matthew:matrix.org.

@davidar
Copy link

davidar commented Nov 29, 2015

👍

@Fil
Copy link

Fil commented Nov 29, 2015

we could start by changing the current behavior to display an "image anchor", rather than nothing.

i.e. if I type Hello ![](img url.jpg), display:

Hello 📸 <= this being a link

rather than

Hello

@ara4n ara4n modified the milestone: Ragnarok Nov 29, 2015
@ara4n
Copy link
Member

ara4n commented Dec 9, 2015

@dkasak
Copy link
Member

dkasak commented Nov 29, 2019

I just wrote up a feature request for this before realizing this issue exists, so I'll put what I wrote here as further motivation/rationale for such a feature.

Automatically upload external images when sent using Markdown syntax

Riot supports Markdown image syntax, but using it is currently cumbersome due to the requirement that the image URL must be an MXC URL (which is a valid requirement for privacy, especially in public rooms; see #4044). However, it makes pasting carefully formatted Markdown messages error-prone and requires manual steps (uploading the images manually, replacing the URLs).

As an example use case, I have a personal knowledge base composed of Markdown notes and I frequently paste such notes to people on Matrix. It works wonderfully except for the fact that images are silently stripped away.

However, I realized this could be fixed on the sender's side by making the sender's Riot automatically fetch the image from the external URL, uploading it to the homeserver and replacing the external URL with the MXC one before sending it. This would increase usability of Markdown image syntax drastically. Are there any downsides to this that I am missing?

@t3chguy
Copy link
Member

t3chguy commented Nov 29, 2019

Are there any downsides to this that I am missing?

A lot of the time CORS will disallow browsers from fetching the external resources

@dkasak
Copy link
Member

dkasak commented Nov 29, 2019

Will it? I often render my notes locally as HTML pages and open them in a browser and I don't think I've ever encountered images not loading due to CORS.

@t3chguy
Copy link
Member

t3chguy commented Apr 10, 2020

Loading the image in an img tag vs loading it in Javascript to access the data and upload is a different matter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Composer A-File-Upload Attachments and file uploads O-Occasional Affects or can be seen by some users regularly or most users rarely S-Tolerable Low/no impact on users T-Enhancement
Projects
None yet
Development

No branches or pull requests

9 participants