From 1cc3b2ed7ebda9e365a42c4684f4fece230ba6e2 Mon Sep 17 00:00:00 2001 From: Rish Date: Mon, 23 Sep 2019 19:58:11 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20tag=20with=20#=20not=20g?= =?UTF-8?q?enerating=20"hash-"=20prefix=20at=20tag=20screen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Ghost/issues/11105 - Updates slug generation on tag screen to add "hash-" prefix for tags with name starting from # --- ghost/admin/app/controllers/tags/tag.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ghost/admin/app/controllers/tags/tag.js b/ghost/admin/app/controllers/tags/tag.js index 1d37c0b82e..93afb56369 100644 --- a/ghost/admin/app/controllers/tags/tag.js +++ b/ghost/admin/app/controllers/tags/tag.js @@ -89,6 +89,9 @@ export default Controller.extend({ // Generate slug based on name for new tag when empty if (propKey === 'name' && !tag.get('slug') && isNewTag) { let slugValue = slugify(newValue); + if (/^#/.test(newValue)) { + slugValue = 'hash-' + slugValue; + } tag.set('slug', slugValue); } // TODO: This is required until .validate/.save mark fields as validated