From 8ea705f0d5eb57b6df51e9539f48b3a6ecf5e131 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Fri, 3 Nov 2023 14:39:43 +0000 Subject: [PATCH] Fix slugify when using hyphens surrounded by spaces. --- resources/js/plugins/slugify.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/js/plugins/slugify.js b/resources/js/plugins/slugify.js index 126ce59237..59ce9a715d 100644 --- a/resources/js/plugins/slugify.js +++ b/resources/js/plugins/slugify.js @@ -15,6 +15,9 @@ export default { // Remove smart single quotes custom["’"] = ""; + // Prevent `Block - Hero` turning into `block_-_hero` + custom[" - "] = " "; + return getSlug(text, { separator: glue || '-', lang,