mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
add nofollow noindex to person_link_to_href
This commit is contained in:
parent
355d0cd860
commit
f0239724c7
1 changed files with 3 additions and 2 deletions
|
@ -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'<a href=https://' + current_app.config['SERVER_NAME'] + r'/user/lookup/'
|
||||
return re.sub(pattern, server + r'\g<1>/\g<2>>' + r'@\g<1>@\g<2></a>', link)
|
||||
server = f'https://{current_app.config["SERVER_NAME"]}/user/lookup/'
|
||||
replacement = (r'<a href="' + server + r'\g<1>/\g<2>" rel="nofollow noindex">@\g<1>@\g<2></a>')
|
||||
return re.sub(pattern, replacement, link)
|
||||
|
||||
|
||||
def domain_from_url(url: str, create=True) -> Domain:
|
||||
|
|
Loading…
Reference in a new issue