aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2020-04-28 13:33:14 +0100
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2020-04-28 13:33:14 +0100
commit854356245a7f744c26f162ce94f2fc1c86aed314 (patch)
treea56343ae5d8ff926ba6f62db36c172174172a593
parentUpdate release script with more automation (diff)
parentMerge branch 'master' into bugfix/html-images (diff)
downloadpaper2remarkable-854356245a7f744c26f162ce94f2fc1c86aed314.tar.gz
paper2remarkable-854356245a7f744c26f162ce94f2fc1c86aed314.zip
Merge branch 'bugfix/html-images'
-rw-r--r--paper2remarkable/providers/html.py1
-rw-r--r--tests/test_providers.py8
2 files changed, 9 insertions, 0 deletions
diff --git a/paper2remarkable/providers/html.py b/paper2remarkable/providers/html.py
index 9f8394c..d71f210 100644
--- a/paper2remarkable/providers/html.py
+++ b/paper2remarkable/providers/html.py
@@ -67,6 +67,7 @@ class ImgProcessor(markdown.treeprocessors.Treeprocessor):
img.attrib["src"] = urllib.parse.urljoin(
self._base_url, img.attrib["src"]
)
+ img.attrib["src"] = img.attrib['src'].rstrip('/')
class HTMLInformer(Informer):
diff --git a/tests/test_providers.py b/tests/test_providers.py
index 0787792..a7f17ff 100644
--- a/tests/test_providers.py
+++ b/tests/test_providers.py
@@ -248,6 +248,14 @@ class TestProviders(unittest.TestCase):
# this is a proxy test to check that all images are included
self.assertEqual(32, len(pdfplumber.open(filename).pages))
+ def test_html_4(self):
+ prov = HTML(upload=False, verbose=VERBOSE)
+ url = "https://sirupsen.com/2019/"
+ filename = prov.run(url)
+ # this is a proxy test to check that all images are included
+ self.assertEqual(4, len(pdfplumber.open(filename).pages))
+
+
if __name__ == "__main__":
unittest.main()