mirror of
https://github.com/sileht/bird-lg.git
synced 2025-03-25 21:44:27 +01:00
Hyperlink ASN only when square-bracketed
This commit is contained in:
parent
2ce03ebbb0
commit
841df1e5a5
1 changed files with 1 additions and 1 deletions
2
lg.py
2
lg.py
|
@ -76,7 +76,7 @@ def add_links(text):
|
|||
ret_text.append(re.sub(r'(\d+)', r'<a href="/whois?q=\1" class="whois">\1</a>', line))
|
||||
else:
|
||||
line = re.sub(r'([a-zA-Z0-9\-]*\.([a-zA-Z]{2,3}){1,2})(\s|$)', r'<a href="/whois?q=\1" class="whois">\1</a>\3', line)
|
||||
line = re.sub(r'AS(\d+)', r'<a href="/whois?q=\1" class="whois">AS\1</a>', line)
|
||||
line = re.sub(r'(?<=\[)AS(\d+)', r'<a href="/whois?q=\1" class="whois">AS\1</a>', line)
|
||||
line = re.sub(r'(\d+\.\d+\.\d+\.\d+)', r'<a href="/whois?q=\1" class="whois">\1</a>', line)
|
||||
if len(request.path) >= 2:
|
||||
hosts = "/".join(request.path.split("/")[2:])
|
||||
|
|
Loading…
Add table
Reference in a new issue