diff --git a/md_pdf/build/template.py b/md_pdf/build/template.py index 15803b2..2d89308 100644 --- a/md_pdf/build/template.py +++ b/md_pdf/build/template.py @@ -22,7 +22,9 @@ def add_base_tag(doc, config): logger.debug("Adding Base Tag...") soup = BeautifulSoup(doc, 'html.parser') for img in soup.findAll('img'): - img['src'] = os.path.abspath(img['src']) + abs_path = os.path.abspath(img['src']) + if os.path.isfile(abs_path): + img['src'] = abs_path return soup.prettify() diff --git a/test-files/3-image.md b/test-files/3-image.md index 0716ec0..88c3a36 100644 --- a/test-files/3-image.md +++ b/test-files/3-image.md @@ -2,3 +2,6 @@ ![title](./test-image.png) + + +![Example remote image](http://image.spreadshirtmedia.com/image-server/v1/designs/11735885,width=178,height=178/TV-Test-Screen.png)