From a8040fd10451f546705d97a2be8f3351b0bf43bb Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 24 Apr 2021 19:01:07 -0300 Subject: s/tabs/spaces/g --- _pastebins/2021-04-03-javascript-naive-slugify.md | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) (limited to '_pastebins') diff --git a/_pastebins/2021-04-03-javascript-naive-slugify.md b/_pastebins/2021-04-03-javascript-naive-slugify.md index 05251c7..ce038fd 100644 --- a/_pastebins/2021-04-03-javascript-naive-slugify.md +++ b/_pastebins/2021-04-03-javascript-naive-slugify.md @@ -16,23 +16,23 @@ ref: javascript-naive-slugify const s = "Pézão: açaí, saci-pererê."; function slugify(s) { - return s - .toLowerCase() - .replaceAll(":", "") - .replaceAll(".", "") - .replaceAll(",", "") - .replaceAll("-", "") - .replaceAll("á", "a") - .replaceAll("ã", "a") - .replaceAll("à", "a") - .replaceAll("é", "e") - .replaceAll("ê", "e") - .replaceAll("í", "i") - .replaceAll("ó", "o") - .replaceAll("ô", "o") - .replaceAll("ú", "u") - .replaceAll("ü", "u") - .replaceAll("ç", "c"); + return s + .toLowerCase() + .replaceAll(":", "") + .replaceAll(".", "") + .replaceAll(",", "") + .replaceAll("-", "") + .replaceAll("á", "a") + .replaceAll("ã", "a") + .replaceAll("à", "a") + .replaceAll("é", "e") + .replaceAll("ê", "e") + .replaceAll("í", "i") + .replaceAll("ó", "o") + .replaceAll("ô", "o") + .replaceAll("ú", "u") + .replaceAll("ü", "u") + .replaceAll("ç", "c"); } console.log(slugify(s)); -- cgit v1.2.3