Skip to content

Commit

Permalink
chore(merge): merge features to release
Browse files Browse the repository at this point in the history
  • Loading branch information
Umaaz committed May 8, 2024
1 parent bcafb28 commit 4a418ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions markdown_include/include.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_include.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "<p>Error loading remote template (https://example.com/cmacmackin/markdown-include/master/tests/resources/not_found.md): HTTP Error 404: Not Found</p>"
assert html == "<p>Error loading remote template (https://github.com/not_found.md): HTTP Error 404: Not Found</p>"


def test_relative_path(markdown_include):
Expand Down

0 comments on commit 4a418ee

Please sign in to comment.