diff --git a/person.py b/person.py index 543bee547..bfe686b49 100644 --- a/person.py +++ b/person.py @@ -1950,7 +1950,8 @@ def get_featured_hashtags(actor_json: {}) -> str: return result.strip() -def get_featured_hashtags_as_html(actor_json: {}) -> str: +def get_featured_hashtags_as_html(actor_json: {}, + profile_description: str) -> str: """returns a html string containing featured hashtags """ result = '' @@ -1981,6 +1982,10 @@ def get_featured_hashtags_as_html(actor_json: {}) -> str: tag_name = tag_name[1:] if not tag_name: continue + if '/tags/' + tag_name + '"' in profile_description: + continue + if ' #' + tag_name in profile_description: + continue tag_url = tag_dict['href'] if '://' not in tag_url: continue diff --git a/webapp_profile.py b/webapp_profile.py index f0d8b50ed..ec2280840 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -269,7 +269,8 @@ def html_profile_after_search(recent_posts_cache: {}, max_recent_posts: int, add_emoji_to_display_name(session, base_dir, http_prefix, nickname, domain, profile_description, False, translate) - featured_hashtags = get_featured_hashtags_as_html(profile_json) + featured_hashtags = \ + get_featured_hashtags_as_html(profile_json, profile_description) outbox_url = None if not profile_json.get('outbox'): if debug: @@ -749,7 +750,8 @@ def html_profile(signing_priv_key_pem: str, profile_description, False, translate) if profile_description: profile_description = standardize_text(profile_description) - featured_hashtags = get_featured_hashtags_as_html(profile_json) + featured_hashtags = \ + get_featured_hashtags_as_html(profile_json, profile_description) posts_button = 'button' following_button = 'button' moved_button = 'button'