From 09ce7d4d59f1af876d08fa3433355c777bd61f80 Mon Sep 17 00:00:00 2001 From: Duncan McClean <19637309+duncanmcclean@users.noreply.github.com> Date: Fri, 3 Nov 2023 14:43:34 +0000 Subject: [PATCH] [4.x] Fix slugify when using hyphens surrounded by spaces. (#8923) --- 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,