def test_with_markdown_symbols_in_the_paragraph_text_that_should_not_be_interpreted(
     self,
 ):
     assert (
         parse("This is a paragraph with # and * in the text")
         == "<p>This is a paragraph with # and * in the text</p>"
     )
Exemplo n.º 2
0
 def test_with_markdown_symbols_in_the_header_text_that_should_not_be_interpreted(
     self
 ):
     self.assertEqual(
         parse("# This is a header with # and * in the text"),
         "<h1>This is a header with # and * in the text</h1>",
     )
Exemplo n.º 3
0
 def test_symbols_in_the_list_item_text_that_should_not_be_interpreted(
         self):
     self.assertEqual(
         parse(
             '* Item 1 with a # in the text\n* Item 2 with * in the text'),
         '<ul><li>Item 1 with a # in the text</li>'
         '<li>Item 2 with * in the text</li></ul>')
 def test_with_markdown_symbols_in_the_header_text_that_should_not_be_interpreted(
     self,
 ):
     assert (
         parse("# This is a header with # and * in the text")
         == "<h1>This is a header with # and * in the text</h1>"
     )
 def test_with_markdown_symbols_in_the_list_item_text_that_should_not_be_interpreted(
     self,
 ):
     assert (
         parse("* Item 1 with a # in the text\n* Item 2 with * in the text")
         == "<ul><li>Item 1 with a # in the text</li><li>Item 2 with * in the text</li></ul>"
     )
Exemplo n.º 6
0
 def test_with_markdown_symbols_in_the_paragraph_text_that_should_not_be_interpreted(
     self
 ):
     self.assertEqual(
         parse("This is a paragraph with # and * in the text"),
         "<p>This is a paragraph with # and * in the text</p>",
     )
Exemplo n.º 7
0
 def test_symbols_in_the_list_item_text_that_should_not_be_interpreted(
         self):
     self.assertEqual(
         parse(
             '* Item 1 with a # in the text\n* Item 2 with * in the text'),
         '<ul><li>Item 1 with a # in the text</li>'
         '<li>Item 2 with * in the text</li></ul>')
Exemplo n.º 8
0
 def test_h6(self):
     self.assertEqual(parse(
         '###### This will be an h6'), '<h6>This will be an h6</h6>')
 def test_parses_normal_text_as_a_paragraph(self):
     assert parse("This will be a paragraph") == "<p>This will be a paragraph</p>"
Exemplo n.º 10
0
 def test_unordered_lists(self):
     assert parse("* Item 1\n* Item 2") == "<ul><li>Item 1</li><li>Item 2</li></ul>"
Exemplo n.º 11
0
 def test_unordered_lists_close_properly_with_preceding_and_following_lines(
         self):
     self.assertEqual(
         parse('# Start a list\n* Item 1\n* Item 2\nEnd a list'),
         '<h1>Start a list</h1><ul><li>Item 1</li>'
         '<li>Item 2</li></ul><p>End a list</p>')
Exemplo n.º 12
0
 def test_unordered_lists(self):
     self.assertEqual(
         parse("* Item 1\n* Item 2"), "<ul><li>Item 1</li><li>Item 2</li></ul>"
     )
Exemplo n.º 13
0
 def test_with_h2_header_level(self):
     self.assertEqual(parse("## This will be an h2"), "<h2>This will be an h2</h2>")
Exemplo n.º 14
0
 def test_parsing_bold_text(self):
     self.assertEqual(
         parse("__This will be bold__"), "<p><strong>This will be bold</strong></p>"
     )
Exemplo n.º 15
0
 def test_parses_normal_text_as_a_paragraph(self):
     self.assertEqual(
         parse("This will be a paragraph"), "<p>This will be a paragraph</p>"
     )
Exemplo n.º 16
0
 def test_h2(self):
     self.assertEqual(parse('## This will be an h2'),
                      '<h2>This will be an h2</h2>')
Exemplo n.º 17
0
 def test_h1(self):
     self.assertEqual(parse('# This will be an h1'),
                      '<h1>This will be an h1</h1>')
Exemplo n.º 18
0
 def test_mixed_normal_italics_and_bold(self):
     self.assertEqual(parse('This will _be_ __mixed__'),
                      '<p>This will <em>be</em> <strong>mixed</strong></p>')
Exemplo n.º 19
0
 def test_bold(self):
     self.assertEqual(parse('__This will be bold__'),
                      '<p><strong>This will be bold</strong></p>')
Exemplo n.º 20
0
 def test_italics(self):
     self.assertEqual(parse('_This will be italic_'),
                      '<p><em>This will be italic</em></p>')
Exemplo n.º 21
0
 def test_paragraph(self):
     self.assertEqual(parse('This will be a paragraph'),
                      '<p>This will be a paragraph</p>')
Exemplo n.º 22
0
 def test_unordered_lists(self):
     self.assertEqual(parse('* Item 1\n* Item 2'),
                      '<ul><li>Item 1</li>'
                      '<li>Item 2</li></ul>')
Exemplo n.º 23
0
 def test_little_bit_of_everything(self):
     self.assertEqual(parse(
         '# Header!\n* __Bold Item__\n* _Italic Item_'),
         '<h1>Header!</h1><ul><li><strong>Bold Item</strong></li>'
         '<li><em>Italic Item</em></li></ul>')
Exemplo n.º 24
0
 def test_parsing_italics(self):
     self.assertEqual(
         parse("_This will be italic_"), "<p><em>This will be italic</em></p>"
     )
Exemplo n.º 25
0
 def test_symbols_in_the_header_text_that_should_not_be_interpreted(self):
     self.assertEqual(
         parse('# This is a header with # and * in the text'),
         '<h1>This is a header with # and * in the text</h1>')
Exemplo n.º 26
0
 def test_with_h1_header_level(self):
     self.assertEqual(parse("# This will be an h1"), "<h1>This will be an h1</h1>")
Exemplo n.º 27
0
 def test_mixed_normal_italics_and_bold_text(self):
     assert (
         parse("This will _be_ __mixed__")
         == "<p>This will <em>be</em> <strong>mixed</strong></p>"
     )
Exemplo n.º 28
0
 def test_with_h6_header_level(self):
     self.assertEqual(
         parse("###### This will be an h6"), "<h6>This will be an h6</h6>"
     )
Exemplo n.º 29
0
 def test_with_h2_header_level(self):
     assert parse("## This will be an h2") == "<h2>This will be an h2</h2>"
Exemplo n.º 30
0
 def test_parsing_bold_text(self):
     assert (
         parse("__This will be bold__")
         == "<p><strong>This will be bold</strong></p>"
     )
Exemplo n.º 31
0
 def test_symbols_in_the_paragraph_text_that_should_not_be_interpreted(
         self):
     self.assertEqual(
         parse('This is a paragraph with # and * in the text'),
         '<p>This is a paragraph with # and * in the text</p>')
Exemplo n.º 32
0
 def test_with_h1_header_level(self):
     assert parse("# This will be an h1") == "<h1>This will be an h1</h1>"
Exemplo n.º 33
0
 def test_symbols_in_the_paragraph_text_that_should_not_be_interpreted(
         self):
     self.assertEqual(
         parse('This is a paragraph with # and * in the text'),
         '<p>This is a paragraph with # and * in the text</p>')
Exemplo n.º 34
0
 def test_with_h6_header_level(self):
     assert parse("###### This will be an h6") == "<h6>This will be an h6</h6>"
Exemplo n.º 35
0
 def test_unordered_lists_close_properly_with_preceding_and_following_lines(
         self):
     self.assertEqual(
         parse('# Start a list\n* Item 1\n* Item 2\nEnd a list'),
         '<h1>Start a list</h1><ul><li>Item 1</li>'
         '<li>Item 2</li></ul><p>End a list</p>')
Exemplo n.º 36
0
 def test_with_a_little_bit_of_everything(self):
     assert (
         parse("# Header!\n* __Bold Item__\n* _Italic Item_")
         == "<h1>Header!</h1><ul><li><strong>Bold Item</strong></li><li><em>Italic Item</em></li></ul>"
     )
Exemplo n.º 37
0
 def test_paragraph(self):
     self.assertEqual(parse('This will be a paragraph'),
                      '<p>This will be a paragraph</p>')
Exemplo n.º 38
0
 def test_unordered_lists_close_properly_with_preceding_and_following_lines(self):
     assert (
         parse("# Start a list\n* Item 1\n* Item 2\nEnd a list")
         == "<h1>Start a list</h1><ul><li>Item 1</li><li>Item 2</li></ul><p>End a list</p>"
     )
Exemplo n.º 39
0
 def test_little_bit_of_everything(self):
     self.assertEqual(
         parse('# Header!\n* __Bold Item__\n* _Italic Item_'),
         '<h1>Header!</h1><ul><li><strong>Bold Item</strong></li>'
         '<li><em>Italic Item</em></li></ul>')
Exemplo n.º 40
0
 def test_several_italics_and_bolds_in_the_same_line(self):
     self.assertEqual(
         parse("This _is_ __one__ _tricky_ __test__."),
         "<p>This <em>is</em> <strong>one</strong> <em>tricky</em> <strong>test</strong>.</p>"
     )
Exemplo n.º 41
0
 def test_symbols_in_the_header_text_that_should_not_be_interpreted(self):
     self.assertEqual(parse('# This is a header with # and * in the text'),
                      '<h1>This is a header with # and * in the text</h1>')
Exemplo n.º 42
0
 def test_parsing_italics(self):
     assert parse("_This will be italic_") == "<p><em>This will be italic</em></p>"
Exemplo n.º 43
0
 def test_unordered_lists(self):
     self.assertEqual(parse('* Item 1\n* Item 2'), '<ul><li>Item 1</li>'
                      '<li>Item 2</li></ul>')