mirror of https://gitlab.com/bashrc2/epicyon
Remove backticks from link text
parent
a5fa18aa35
commit
ee5ddb09ee
10
markdown.py
10
markdown.py
|
@ -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():
|
||||||
|
|
Loading…
Reference in New Issue