Skip to content

Commit 1d43b17

Browse files
committed
fix: error using external links in markdown
1 parent f339fa0 commit 1d43b17

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mkdocs_embed_file_plugins/src/links_correction.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ def convert_links_if_markdown(quote_str, base) :
2323
url_blog_path = [x for x in url_blog.split('/') if len(x) > 0]
2424
url_blog_path = url_blog_path[len(url_blog_path) - 1]
2525
for link in links :
26-
internal_link = Path(md_link_path, link[1]).resolve()
27-
url = create_url(internal_link, link[1], base, url_blog_path, False)
28-
quote_str = quote_str.replace(link[1], url)
26+
if not link[1].startswith('http') :
27+
internal_link = Path(md_link_path, link[1]).resolve()
28+
url = create_url(internal_link, link[1], base, url_blog_path, False)
29+
quote_str = quote_str.replace(link[1], url)
2930
return quote_str
3031

3132

0 commit comments

Comments
 (0)