Skip to content

Commit

Permalink
Fix slugify and cleanDiacritics for œ and æ
Browse files Browse the repository at this point in the history
œ is converted to oe and æ to ae.
  • Loading branch information
jazzzz committed Sep 13, 2017
1 parent aad621d commit 9033c9d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cleanDiacritics.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

var makeString = require('./helper/makeString');

var from = 'ąàáäâãåæăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșşšŝťțţŭùúüűûñÿýçżźž',
to = 'aaaaaaaaaccceeeeeghiiiijllnnoooooooossssstttuuuuuunyyczzz';
var from = 'ąàáäâãåăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșşšŝťțţŭùúüűûñÿýçżźž',
to = 'aaaaaaaaccceeeeeghiiiijllnnoooooooossssstttuuuuuunyyczzz';

from += from.toUpperCase();
to += to.toUpperCase();
Expand All @@ -12,6 +12,10 @@ to = to.split('');
// for tokens requireing multitoken output
from += 'ß';
to.push('ss');
from += 'œ';
to.push('oe');
from += 'æ';
to.push('ae');


module.exports = function cleanDiacritics(str) {
Expand Down

0 comments on commit 9033c9d

Please sign in to comment.