mirror of
https://gitlab.com/brutaldon/brutaldon.git
synced 2024-12-04 14:46:24 -05:00
Better error handling in tag linkification
This commit is contained in:
parent
dc590b65ee
commit
c92c28b55a
@ -24,7 +24,10 @@ def relink_tags(value):
|
||||
value = value.replace(''', "'")
|
||||
soup = BeautifulSoup(value, 'html.parser')
|
||||
for link in soup.find_all('a', class_='hashtag'):
|
||||
link['href'] = reverse('tag', args=[link.span.string])
|
||||
try:
|
||||
link['href'] = reverse('tag', args=[link.span.string])
|
||||
except:
|
||||
continue
|
||||
return soup.decode(formatter='html')
|
||||
|
||||
@register.filter
|
||||
@ -74,5 +77,5 @@ def fix_emojos(value, emojos):
|
||||
value = value.replace(":%(shortcode)s:" % emojo,
|
||||
'<img src="%(url)s" title=":%(shortcode)s:" alt=":%(shortcode)s:" class="emoji">' % emojo)
|
||||
except:
|
||||
pass
|
||||
continue
|
||||
return value
|
||||
|
Loading…
Reference in New Issue
Block a user