fix: replace umlaut characters with ASCII equivalents in cleanTitle (#481)

Update the cleanTitle() function in utils.ts to replace umlaut characters with their ASCII transliterations
This commit is contained in:
nexariton
2025-11-13 16:11:41 +01:00
committed by GitHub
parent b3781af2a4
commit 2b33abab26
+5 -1
View File
@@ -84,7 +84,11 @@ export function normaliseTitle(title: string) {
}
export function cleanTitle(title: string) {
let cleaned = title.normalize('NFD');
const umlautMap: Record<string,string> = {
'Ä':'Ae','ä':'ae','Ö':'Oe','ö':'oe','Ü':'Ue','ü':'ue','ß':'ss'
};
// replace German umlauts with ASCII equivalents, then normalize to NFD
let cleaned = title.replace(/[ÄäÖöÜüß]/g, c => umlautMap[c]).normalize('NFD');
for (const char of ['♪', '♫', '★', '☆', '♡', '♥', '-']) {
cleaned = cleaned.replaceAll(char, ' ');