paginagmbh/redmine_lightbox2

Filename with # character

huynhdnguyen opened this issue · 1 comments

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?

// 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;
}
});