diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index 10863a316c9..b9a4e4d5505 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -50,7 +50,7 @@ module SettingsHelper def post_link_to_featured_tag(tag) link_to( - "##{tag.display_name}", + tag.formatted_name, settings_featured_tags_path(featured_tag: { name: tag.name }), method: :post ) diff --git a/app/models/featured_tag.rb b/app/models/featured_tag.rb index cdd97205eb7..e7ffc6e258b 100644 --- a/app/models/featured_tag.rb +++ b/app/models/featured_tag.rb @@ -40,6 +40,10 @@ class FeaturedTag < ApplicationRecord attributes['name'] || tag.display_name end + def formatted_name + "##{attributes['name']}" || tag.formatted_name + end + def increment(timestamp) update(statuses_count: statuses_count + 1, last_status_at: timestamp) end diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb index 4ab48ff204b..1eed92f4d31 100644 --- a/app/serializers/activitypub/actor_serializer.rb +++ b/app/serializers/activitypub/actor_serializer.rb @@ -186,7 +186,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer end def name - "##{object.name}" + object.formatted_name end end diff --git a/app/serializers/activitypub/hashtag_serializer.rb b/app/serializers/activitypub/hashtag_serializer.rb index 2b24eb8cc15..e33bf76802a 100644 --- a/app/serializers/activitypub/hashtag_serializer.rb +++ b/app/serializers/activitypub/hashtag_serializer.rb @@ -12,7 +12,7 @@ class ActivityPub::HashtagSerializer < ActivityPub::Serializer end def name - "##{object.display_name}" + object.formatted_name end def href diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index 27e058199d6..23d15c0e0d5 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -269,7 +269,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer end def name - "##{object.name}" + object.formatted_name end end