i'm trying to do a simple string replace using the code and function below, but for some reason å ä ö gets replaced with nothing (not even a space).
I would like å and ä to be replaced by "a" and ö by "o"...
"ål öl är" becomes: "l-l-r" Any ideas?
let context = 'ål öl är'
const slugify = str =>
str
.toLowerCase()
.trim()
.replace(/[^\w\s-]/g, '')
.replace(/[\s_-]+/g, '-')
.replace(/^-+|-+$/g, '')
.replace(/[åä]/g, 'a')
.replace('ö', 'o');
let slug = slugify(context);
console.log(slug);