mirror of
https://github.com/jfmcbrayer/brutaldon
synced 2025-01-25 13:28:31 +01:00
Work around bug(?) in BeautifulSoup entity handling
This commit is contained in:
parent
dc5d5f4176
commit
3390266b29
@ -21,6 +21,7 @@ def relink_tags(value):
|
|||||||
|
|
||||||
FIXME: handle arbitrary tag links
|
FIXME: handle arbitrary tag links
|
||||||
'''
|
'''
|
||||||
|
value = value.replace(''', "'")
|
||||||
soup = BeautifulSoup(value, 'html.parser')
|
soup = BeautifulSoup(value, 'html.parser')
|
||||||
for link in soup.find_all('a', class_='hashtag'):
|
for link in soup.find_all('a', class_='hashtag'):
|
||||||
link['href'] = reverse('tag', args=[link.span.string])
|
link['href'] = reverse('tag', args=[link.span.string])
|
||||||
@ -36,6 +37,7 @@ def relink_mentions(value):
|
|||||||
|
|
||||||
FIXME: handle arbitrary mention links
|
FIXME: handle arbitrary mention links
|
||||||
'''
|
'''
|
||||||
|
value = value.replace(''', "'")
|
||||||
soup = BeautifulSoup(value, 'html.parser')
|
soup = BeautifulSoup(value, 'html.parser')
|
||||||
for link in soup.find_all('a', class_='mention'):
|
for link in soup.find_all('a', class_='mention'):
|
||||||
parsed = parse.urlparse(link['href'])
|
parsed = parse.urlparse(link['href'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user