Fix keying
This commit is contained in:
parent
28dd345219
commit
85ebe76f5f
1 changed files with 4 additions and 4 deletions
|
@ -61,10 +61,10 @@ def get_text(element, links, images):
|
|||
return f'<underline>{element.text}</underline>'
|
||||
for a in element.find_all('a'):
|
||||
soup = BeautifulSoup("", "html.parser")
|
||||
if (element['href'] != element.text
|
||||
and 'mention' not in element.get('class', [])
|
||||
and 'tag' not in element.get('rel', [])):
|
||||
links.append(a.href)
|
||||
if (a['href'] != element.text
|
||||
and 'mention' not in a.get('class', [])
|
||||
and 'tag' not in a.get('rel', [])):
|
||||
links.append(a['href'])
|
||||
new_tag = soup.new_tag('a')
|
||||
new_tag.string = '<cyan>' + a.text + '</cyan>'
|
||||
a.replace_with(new_tag)
|
||||
|
|
Loading…
Reference in a new issue