1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2025-07-12 22:21:23 +02:00

Disallow Hyphens in File Names (#5121)

This commit is contained in:
Peter Noble
2021-05-05 11:22:54 +01:00
committed by GitHub
parent 1009182803
commit ead1170a2f
5 changed files with 92 additions and 37 deletions

View File

@ -17,12 +17,8 @@ module.exports = {
titleToSlug: title => (
title.toLowerCase()
.replace(/\+/g, "plus")
.replace(/^\./, "dot-")
.replace(/\.$/, "-dot")
.replace(/\./g, "-dot-")
.replace(/^&/, "and-")
.replace(/&$/, "-and")
.replace(/&/g, "-and-")
.replace(/\./g, "dot")
.replace(/&/g, "and")
.replace(/đ/g, "d")
.replace(/ħ/g, "h")
.replace(/ı/g, "i")
@ -32,8 +28,7 @@ module.exports = {
.replace(/ß/g, "ss")
.replace(/ŧ/g, "t")
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "")
.replace(/[^a-z0-9\-]/g, "")
.replace(/[^a-z0-9]/g, "")
),
/**