diff --git a/tests/test_markdown_support.py b/tests/test_markdown_support.py new file mode 100644 index 000000000..4e4b8cbf3 --- /dev/null +++ b/tests/test_markdown_support.py @@ -0,0 +1,34 @@ +import pymupdf +import os + + +def test_archive_markdown(): + """Test Archive support.""" + path = os.path.abspath(f"{__file__}/../../tests/resources") + md = b"\n\n**A referenced image.**" + md_doc = pymupdf.open(stream=md, filetype="md", archive=path) + pdfdata = md_doc.convert_to_pdf() + doc = pymupdf.open(stream=pdfdata) + page = doc[0] + images = page.get_image_info() + assert len(images) == 1 + +def test_archive_links(): + """Create an internal and an external link and confirm + that they are correctly converted to PDF links.""" + md = """Some text containing an external [link](http://www.google.com) to Google. + Now an internal link to a header in this document: [Some Header](#some-header). The header is here: + +