From 9033c9d9491288ccedf102f3da0bf8d51a69d8c9 Mon Sep 17 00:00:00 2001 From: Ludovic Perrine Date: Wed, 13 Sep 2017 14:57:54 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20slugify=20and=20cleanDiacritics=20for=20?= =?UTF-8?q?=C5=93=20and=20=C3=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit œ is converted to oe and æ to ae. --- cleanDiacritics.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cleanDiacritics.js b/cleanDiacritics.js index d877006a..f9101932 100644 --- a/cleanDiacritics.js +++ b/cleanDiacritics.js @@ -1,8 +1,8 @@ var makeString = require('./helper/makeString'); -var from = 'ąàáäâãåæăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșşšŝťțţŭùúüűûñÿýçżźž', - to = 'aaaaaaaaaccceeeeeghiiiijllnnoooooooossssstttuuuuuunyyczzz'; +var from = 'ąàáäâãåăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșşšŝťțţŭùúüűûñÿýçżźž', + to = 'aaaaaaaaccceeeeeghiiiijllnnoooooooossssstttuuuuuunyyczzz'; from += from.toUpperCase(); to += to.toUpperCase(); @@ -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) {