mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
added comment
This commit is contained in:
parent
ff43df1a21
commit
82704ae421
1 changed files with 1 additions and 0 deletions
|
@ -191,6 +191,7 @@ def allowlist_html(html: str) -> str:
|
|||
url = False
|
||||
for t in re_url.split(tag.string):
|
||||
if re_url.match(t):
|
||||
# Avoid picking up trailing punctuation for raw URLs in text
|
||||
href = t[:-1] if t[-1] in ['.', ',', ')', '!', ':', ';', '?'] else t
|
||||
a = soup.new_tag("a", href=href)
|
||||
a.string = href
|
||||
|
|
Loading…
Reference in a new issue