File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -42,3 +42,36 @@ def test_en(self):
4242 pdf .meta ["author" ] = "Vitaly Bogomolov"
4343
4444 pdf .save (self .build ("readme.pdf" ))
45+
46+ def test_user_case_1 (self ):
47+ """Test user case from discussion."""
48+ from markdown_pdf import Section , MarkdownPdf
49+
50+ document_text_2 = """
51+ # Test Header 0
52+
53+ Here's some background.
54+
55+ ## Test Header 1
56+
57+ ### 🗂️ Header 2 with hyperlink [link](http://www.example.com)
58+
59+ Some **Bold Text**
60+
61+ A lot more text here
62+ """
63+
64+ document_text = "# Test Header 0\n "
65+ document_text += "\n Here's some background.\n "
66+ document_text += "\n ## Test Header 1\n "
67+ document_text += "\n ### 🗂️ Header 2 with hyperlink [link](http://www.example.com)\n "
68+ document_text += "Some **Bold Text**\n "
69+ document_text += "\n A lot more text here"
70+
71+ pdf = MarkdownPdf (toc_level = 2 , optimize = True )
72+ pdf .add_section (Section (document_text , toc = False ))
73+ pdf .save (self .build ("rendered1.pdf" ))
74+
75+ pdf = MarkdownPdf (toc_level = 2 , optimize = True )
76+ pdf .add_section (Section (document_text_2 , toc = False ))
77+ pdf .save (self .build ("rendered2.pdf" ))
You can’t perform that action at this time.
0 commit comments