Skip to content

Commit 76b7405

Browse files
committed
fix: image and other links broken
1 parent cd90953 commit 76b7405

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mkdocs_embed_file_plugins/plugin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,13 @@ def mini_ez_links(urlo, base, end, url_whitespace, url_case):
8888
internal_link = file_name
8989
file_path = internal_link.replace(base, '')
9090
url = file_path.replace('\\', '/').replace('.md', '')
91-
url = url_blog + '/' + quote(url)
92-
url = url.replace('//', '/')
93-
if not url.startswith(('https:/', 'http:/')):
91+
url = re.sub(r'\/$', '', str(url_blog)) + '/' + quote(url)
92+
if not url.startswith('http'):
9493
url = 'https://' + url
9594
if not url.endswith('/') and not url.endswith(('png', 'jpg', 'jpeg', 'gif', 'webm')):
9695
url = url + '/'
9796
return url
9897

99-
10098
def strip_comments(markdown):
10199
file_content = markdown.split('\n')
102100
markdown = ''

0 commit comments

Comments
 (0)