mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🐛 Fixed tag with # not generating "hash-" prefix at tag screen
closes https://github.com/TryGhost/Ghost/issues/11105 - Updates slug generation on tag screen to add "hash-" prefix for tags with name starting from #
This commit is contained in:
parent
b62b8e4142
commit
1cc3b2ed7e
1 changed files with 3 additions and 0 deletions
|
@ -89,6 +89,9 @@ export default Controller.extend({
|
||||||
// Generate slug based on name for new tag when empty
|
// Generate slug based on name for new tag when empty
|
||||||
if (propKey === 'name' && !tag.get('slug') && isNewTag) {
|
if (propKey === 'name' && !tag.get('slug') && isNewTag) {
|
||||||
let slugValue = slugify(newValue);
|
let slugValue = slugify(newValue);
|
||||||
|
if (/^#/.test(newValue)) {
|
||||||
|
slugValue = 'hash-' + slugValue;
|
||||||
|
}
|
||||||
tag.set('slug', slugValue);
|
tag.set('slug', slugValue);
|
||||||
}
|
}
|
||||||
// TODO: This is required until .validate/.save mark fields as validated
|
// TODO: This is required until .validate/.save mark fields as validated
|
||||||
|
|
Loading…
Add table
Reference in a new issue