diff options
author | Isaac Muse <faceless.shop@gmail.com> | 2019-09-03 08:20:59 -0600 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2019-09-03 10:20:59 -0400 |
commit | ce04b81f4e7397de391df895e0f915a67f611c91 (patch) | |
tree | d56ec143d3f63259207d030b58bc7addadf298c6 /tests/test_syntax | |
parent | 59a97092e815c15ee29a670877d091d8bae442b1 (diff) | |
download | python-markdown-ce04b81f4e7397de391df895e0f915a67f611c91.tar.gz |
Refactor em strong to consolidate code and fix issue #792
Diffstat (limited to 'tests/test_syntax')
-rw-r--r-- | tests/test_syntax/extensions/test_legacy_em.py | 14 | ||||
-rw-r--r-- | tests/test_syntax/inline/test_emphasis.py | 31 |
2 files changed, 45 insertions, 0 deletions
diff --git a/tests/test_syntax/extensions/test_legacy_em.py b/tests/test_syntax/extensions/test_legacy_em.py index ddb2079..e173242 100644 --- a/tests/test_syntax/extensions/test_legacy_em.py +++ b/tests/test_syntax/extensions/test_legacy_em.py @@ -38,3 +38,17 @@ class TestLegacyEm(TestCase): '<p><strong>connected</strong>words__</p>', extensions=['legacy_em'] ) + + def test_complex_emphasis_underscore(self): + self.assertMarkdownRenders( + 'This is text __bold _italic bold___ with more text', + '<p>This is text <strong>bold <em>italic bold</em></strong> with more text</p>', + extensions=['legacy_em'] + ) + + def test_complex_emphasis_underscore_mid_word(self): + self.assertMarkdownRenders( + 'This is text __bold_italic bold___ with more text', + '<p>This is text <strong>bold<em>italic bold</em></strong> with more text</p>', + extensions=['legacy_em'] + ) diff --git a/tests/test_syntax/inline/test_emphasis.py b/tests/test_syntax/inline/test_emphasis.py index d96861b..ba01d70 100644 --- a/tests/test_syntax/inline/test_emphasis.py +++ b/tests/test_syntax/inline/test_emphasis.py @@ -84,3 +84,34 @@ class TestNotEmphasis(TestCase): '_ bar _', '<p>_ bar _</p>' ) + + def test_complex_emphasis_asterisk(self): + self.assertMarkdownRenders( + 'This is text **bold *italic bold*** with more text', + '<p>This is text <strong>bold <em>italic bold</em></strong> with more text</p>' + ) + + def test_complex_emphasis_asterisk_mid_word(self): + self.assertMarkdownRenders( + 'This is text **bold*italic bold*** with more text', + '<p>This is text <strong>bold<em>italic bold</em></strong> with more text</p>' + ) + + def test_complex_emphasis_smart_underscore(self): + self.assertMarkdownRenders( + 'This is text __bold _italic bold___ with more text', + '<p>This is text <strong>bold <em>italic bold</em></strong> with more text</p>' + ) + + def test_complex_emphasis_smart_underscore_mid_word(self): + self.assertMarkdownRenders( + 'This is text __bold_italic bold___ with more text', + '<p>This is text __bold_italic bold___ with more text</p>' + ) + + def test_nested_emphasis(self): + + self.assertMarkdownRenders( + 'This text is **bold *italic* *italic* bold**', + '<p>This text is <strong>bold <em>italic</em> <em>italic</em> bold</strong></p>' + ) |