Images with ] character in filename don't display properly

Not the filename, the insertion text:

![31]|690x387](upload://nAo0GVB2DXSk484vgstfhPG1BQv.jpg)
----^

Do you see the character I have marked above with the ^ caret? It is incorrect.

In the above example the filename of the image I uploaded was ..

http-error-404-not-found.jpg

.. on disk which results in

![http-error-404-not-found|499x499](upload://jw2BCroZfVX1dZChRVVvApQAjrh.jpg)

Your image, on disk, must have ] in the filename and this is causing problems:

bad filename].jpg

Perhaps this is a bug in Discourse, we should probably remove those bracket characters @vinothkannans as they are valid in filenames at least in Windows, and we are only using them for the alt text anyway.

5 Likes