File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 22from markdown import parse_markdown
33
44
5- # Tests adapted from `problem-specifications//canonical-data.json` @ v1.2 .0
5+ # Tests adapted from `problem-specifications//canonical-data.json` @ v1.3 .0
66
77class MarkdownTest (unittest .TestCase ):
88
@@ -45,6 +45,25 @@ def test_little_bit_of_everything(self):
4545 '<h1>Header!</h1><ul><li><strong>Bold Item</strong></li>'
4646 '<li><em>Italic Item</em></li></ul>' )
4747
48+ def test_symbols_in_the_header_text_that_should_not_be_interpreted (self ):
49+ self .assertEqual (
50+ parse_markdown ('# This is a header with # and * in the text' ),
51+ '<h1>This is a header with # and * in the text</h1>' )
52+
53+ def test_symbols_in_the_list_item_text_that_should_not_be_interpreted (
54+ self ):
55+ self .assertEqual (
56+ parse_markdown (
57+ '* Item 1 with a # in the text\n * Item 2 with * in the text' ),
58+ '<ul><li>Item 1 with a # in the text</li>'
59+ '<li>Item 2 with * in the text</li></ul>' )
60+
61+ def test_symbols_in_the_paragraph_text_that_should_not_be_interpreted (
62+ self ):
63+ self .assertEqual (
64+ parse_markdown ('This is a paragraph with # and * in the text' ),
65+ '<p>This is a paragraph with # and * in the text</p>' )
66+
4867
4968if __name__ == '__main__' :
5069 unittest .main ()
You can’t perform that action at this time.
0 commit comments