Encoding names for URL construction, fixes #770

This commit is contained in:
James Barnsley
2021-10-02 13:40:17 +13:00
parent f9bc7dc2f5
commit 08db93a885
2 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ const GridItem = ({
to = `/${item.type}/${encodeUri(item.uri)}`;
if (item.name && item.type !== 'artist') {
// Strip out "%"; this causes conflicts with our uri decoder
to += `/${item.name.replace('%','')}`;
to += `/${encodeURIComponent(item.name.replace('%', ''))}`;
}
}

View File

@ -139,7 +139,7 @@ const ListItem = ({
to = item.link;
} else {
to = `/${item.type}/${encodeUri(item.uri)}`;
if (item.name && item.type !== 'artist') to += `/${item.name}`;
if (item.name && item.type !== 'artist') to += `/${encodeURIComponent(item.name)}`;
}
if (e.target.tagName.toLowerCase() !== 'a') {