Image links with query string results in weird-looking filename caption

Embedding images with links containing a query string, e.g. foo.com/attachments/token/sc1kod6qalzegkg/?name=sunset.jpg
results in weird-looking filename caption “?name=sunset.jpg”.

Maybe check for query string?

Do you have an actual example I can check?

It happens with img tags, for instance:

<img src="https://support.formlabs.com/attachments/token/8Arjif5NfwPnqcGgGD9LHBKn8/?name=P1020315_s.jpg">

2개의 좋아요

A generic fix would be to have the composer generate an alt property from the URL and change the lightbox to display that value as the image title instead – allowing users to enter a filename or description manually, if so desired.

We could try to regex out a filename, but that might be error prone too. At least the filename is in the querystring, so it is fairly clear what it is:

?name=P1020315_s.jpg

캡션에 적절한 출처를 포함하는 것이 좋으므로 이 문제를 다시 올립니다. 예를 들어 Unsplash 이미지 등에 대한 출처 표기 등이 해당됩니다.

미리보기에서는 잘 보입니다:

하지만 마우스를 올렸을 때 링크가 해석되지 않습니다:

2개의 좋아요