OpenSlides/client/src/app/shared/utils/reconvert-chars.ts
2019-07-16 10:39:53 +02:00

20 lines
565 B
TypeScript

/**
* This function converts german umlauts back.
*
* @param text
*
* @returns {string} The whole text with german umlauts.
*/
export function reconvertChars(text: string): string {
return text
.replace(/ä|ä/g, 'ä')
.replace(/Ä|Ä/g, 'Ä')
.replace(/ö|ö/g, 'ö')
.replace(/Ö|Ö/g, 'Ö')
.replace(/ü/g, 'ü')
.replace(/Ü/g, 'Ü')
.replace(/å|å/g, 'å')
.replace(/Å|Å/g, 'Å')
.replace(/ß|ß/g, 'ß');
}