OpenSlides/client/src/app/shared/utils/reconvert-chars.ts

20 lines
565 B
TypeScript
Raw Normal View History

2019-07-12 16:47:11 +02:00
/**
* 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, 'å')
2019-07-12 18:25:15 +02:00
.replace(/Å|Å/g, 'Å')
.replace(/ß|ß/g, 'ß');
2019-07-12 16:47:11 +02:00
}