Remove backticks from link text

main
Bob Mottram 2022-06-27 13:55:31 +01:00
parent a5fa18aa35
commit ee5ddb09ee
1 changed files with 5 additions and 5 deletions

View File

@ -135,20 +135,20 @@ def _markdown_replace_links(markdown: str, images: bool = False) -> str:
'(' not in markdown_link: '(' not in markdown_link:
text = text.split(')', 1)[1] text = text.split(')', 1)[1]
continue continue
link_text = markdown_link.split(start_chars)[1].split(']')[0]
link_text = link_text.replace('`', '')
if not images: if not images:
replace_links[markdown_link] = \ replace_links[markdown_link] = \
'<a href="' + \ '<a href="' + \
markdown_link.split('(')[1].split(')')[0] + \ markdown_link.split('(')[1].split(')')[0] + \
'" target="_blank" rel="nofollow noopener noreferrer">' + \ '" target="_blank" rel="nofollow noopener noreferrer">' + \
markdown_link.split(start_chars)[1].split(']')[0] + \ link_text + '</a>'
'</a>'
else: else:
link_text = markdown_link.split(start_chars)[1].split(']')[0]
replace_links[markdown_link] = \ replace_links[markdown_link] = \
'<img class="markdownImage" src="' + \ '<img class="markdownImage" src="' + \
markdown_link.split('(')[1].split(')')[0] + \ markdown_link.split('(')[1].split(')')[0] + \
'" alt="' + \ '" alt="' + link_text + '" />'
markdown_link.split(start_chars)[1].split(']')[0] + \
'" />'
text = text.split(')', 1)[1] text = text.split(')', 1)[1]
for md_link, html_link in replace_links.items(): for md_link, html_link in replace_links.items():