mirror of https://gitlab.com/bashrc2/epicyon
Bookmark links
parent
98366a17de
commit
0d9c5d888b
|
@ -198,10 +198,16 @@ def _markdown_replace_links(markdown: str) -> str:
|
|||
section_text = \
|
||||
section_text.replace('!' + replace_str, html_link)
|
||||
if replace_str in section_text:
|
||||
if not link_url.startswith('#'):
|
||||
# external link
|
||||
html_link = \
|
||||
'<a href="' + link_url + '" target="_blank" ' + \
|
||||
'rel="nofollow noopener noreferrer">' + \
|
||||
link_text + '</a>'
|
||||
else:
|
||||
# bookmark
|
||||
html_link = \
|
||||
'<a href="' + link_url + '">' + link_text + '</a>'
|
||||
section_text = \
|
||||
section_text.replace(replace_str, html_link)
|
||||
ctr += 1
|
||||
|
|
Loading…
Reference in New Issue