postprocess_content: Un-URI-escape filename in title.

The filename contains URI-escaped characters, which do not need to be
escaped for safety -- they only make the filename in the tooltip less
readable.
This commit is contained in:
Alex Vandiver
2024-08-29 19:05:25 +00:00
committed by Tim Abbott
parent 6c1a8185aa
commit b8e4bdccd8

View File

@@ -75,7 +75,11 @@ export function postprocess_content(html: string): string {
// not display the URL like it does in the web app. // not display the URL like it does in the web app.
title = legacy_title = $t( title = legacy_title = $t(
{defaultMessage: "Download {filename}"}, {defaultMessage: "Download {filename}"},
{filename: url.pathname.slice(url.pathname.lastIndexOf("/") + 1)}, {
filename: decodeURIComponent(
url.pathname.slice(url.pathname.lastIndexOf("/") + 1),
),
},
); );
} else { } else {
title = url.toString(); title = url.toString();