From 4a418eec72a305db4d465f0ba07f89c6f06c6d85 Mon Sep 17 00:00:00 2001 From: Ben Donnelly Date: Wed, 8 May 2024 10:51:03 +0100 Subject: [PATCH] chore(merge): merge features to release --- markdown_include/include.py | 1 + tests/test_include.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/markdown_include/include.py b/markdown_include/include.py index e729142..dcea5a7 100644 --- a/markdown_include/include.py +++ b/markdown_include/include.py @@ -223,6 +223,7 @@ def load_remote(self, filename): data = urlopen.read() file.write(data) except urllib.error.HTTPError as e: + e.read().decode() file.write( bytes(f"Error loading remote template ({filename}): {e}", "utf-8") ) diff --git a/tests/test_include.py b/tests/test_include.py index 1397af3..27c899e 100644 --- a/tests/test_include.py +++ b/tests/test_include.py @@ -29,10 +29,10 @@ def test_include_remote(markdown_include): def test_include_remote_not_found(markdown_include): - source = "{!https://example.com/cmacmackin/markdown-include/master/tests/resources/not_found.md!}" + source = "{!https://github.com/not_found.md!}" html = markdown.markdown(source, extensions=[markdown_include]) - assert html == "

Error loading remote template (https://example.com/cmacmackin/markdown-include/master/tests/resources/not_found.md): HTTP Error 404: Not Found

" + assert html == "

Error loading remote template (https://github.com/not_found.md): HTTP Error 404: Not Found

" def test_relative_path(markdown_include):