fix: issue #3504 umlaut encoding

updated slugify middleware to handle umlauts to specification
This commit is contained in:
ATOMktn 2020-06-25 18:33:05 -04:00 committed by GitHub
parent a44ec015a6
commit 0cd7b6cf7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,14 @@ import slugify from 'slug'
export default async function uniqueSlug(string, isUnique) {
const slug = slugify(string || 'anonymous', {
lower: true,
charmap: {
'Ä' : 'ae',
'ä' : 'ae',
'Ö' : 'oe',
'ö' : 'oe',
'Ü' : 'ue',
'ü' : 'ue',
}
})
if (await isUnique(slug)) return slug