From 9fc98a738b5e5d901eff565eef48936d9aa3674b Mon Sep 17 00:00:00 2001 From: Benaiah Mischenko Date: Tue, 14 Mar 2017 13:39:56 -0700 Subject: [PATCH] Disallow full stops in entry slugs Full stops in slugs were preventing branch creation for unpublished entries when using the editorial workflow, as `.` is not an allowed character in branch names. This commit changes slug generation so periods are replaced with `-` the same way other "non-sluggable" characters are. --- src/backends/backend.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/backend.js b/src/backends/backend.js index 49ed91e9..5cdc4454 100644 --- a/src/backends/backend.js +++ b/src/backends/backend.js @@ -34,7 +34,7 @@ const slugFormatter = (template = "{{slug}}", entryData) => { case "day": return (`0${ date.getDate() }`).slice(-2); case "slug": - return identifier.trim().toLowerCase().replace(/[^a-z0-9\.\-_]+/gi, "-"); + return identifier.trim().toLowerCase().replace(/[^a-z0-9\-_]+/gi, "-"); default: return entryData.get(field, "").trim().toLowerCase().replace(/[^a-z0-9\.\-_]+/gi, "-"); }