paginagmbh / redmine_lightbox2

Lightbox for image attachments in Redmine
MIT License
126 stars 97 forks source link

Filename with # character #84

Open huynhdnguyen opened 3 years ago

huynhdnguyen commented 3 years ago

Hi In history, hyperlink filename is not formatted ASCII when using a special character (#) so the image is not shown in a lightbox.

img

can you help me fix it?

huynhdnguyen commented 3 years ago

// modify filename links in journal details -> add filename to url to support fancybox preview $("div.journal ul.details li a:not([title])").attr('href', function(i, v){ if($(this).html().match(extensionRegexAll)) { // return v.replace(/\/attachments\/(\d+)/g,'/attachments/download/$1') + '/' + $(this).html(); return v.replace(/\/attachments\/(\d+)/g,'/attachments/download/$1') + '/' + encodeURIComponent($(this).html().replace('&"amp";','&')); } else { return v; } });