From f0239724c75bea2742b230aa4355d152030a4adc Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sat, 11 Jan 2025 16:10:07 +1300 Subject: [PATCH] add nofollow noindex to person_link_to_href --- app/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/utils.py b/app/utils.py index cb352aa7..fe5cb3bc 100644 --- a/app/utils.py +++ b/app/utils.py @@ -460,8 +460,9 @@ def community_link_to_href(link: str) -> str: def person_link_to_href(link: str) -> str: pattern = r"@([a-zA-Z0-9_.-]*)@([a-zA-Z0-9_.-]*)\b" - server = r'/\g<2>>' + r'@\g<1>@\g<2>', link) + server = f'https://{current_app.config["SERVER_NAME"]}/user/lookup/' + replacement = (r'@\g<1>@\g<2>') + return re.sub(pattern, replacement, link) def domain_from_url(url: str, create=True) -> Domain: