That question is actually more JavaScript related than n8n and you should find help if you check on Google. So like something like this:
You would then get something like this:
const content = "<p>Detta är ett test för att visa nils hur det fungerar </p>"
const cleanContent = content.replace(/(<([^>]+)>)/ig, '').replace(/ä/ig, 'ä');
For each special character like the “ä” you would then have to add another .replace(/ä/ig, 'ä').