|
| 1 | +# coding:utf-8 |
| 2 | +from base import TestBase |
| 3 | + |
| 4 | +class TestItalic(TestBase): |
| 5 | + """Test for attributes 'bracket'""" |
| 6 | + |
| 7 | + # for debug |
| 8 | + # def tearDown(self): |
| 9 | + # pass |
| 10 | + |
| 11 | + # TODO: How can we remove "autolink=true" only in these tests below ? |
| 12 | + |
| 13 | + bracket_text = \ |
| 14 | +""" |
| 15 | +
|
| 16 | +<!-- MarkdownTOC autolink=true --> |
| 17 | +
|
| 18 | +<!-- /MarkdownTOC --> |
| 19 | +
|
| 20 | +# this is _italic_ |
| 21 | +# _this is italic_ |
| 22 | +# _this is not italic __ |
| 23 | +# this _is italic_ |
| 24 | +# _ this is not italic _ |
| 25 | +# 2 _ this is not italic _ |
| 26 | +# _this is not italic with markdown error _ |
| 27 | +# 2 _this is not italic with markdown error _ |
| 28 | +# `_should ignore underscores in codeblocks_` |
| 29 | +# `_should ignore underscores in codeblocks 2_ ` |
| 30 | +# this is ` _more complex_ ` exmaple |
| 31 | +""" |
| 32 | + |
| 33 | + def test_italic_in_inheading1(self): |
| 34 | + toc = self.init_update(self.bracket_text)['toc'] |
| 35 | + self.assert_In('- [this is _italic_](#this-is-italic)', toc) |
| 36 | + |
| 37 | + def test_italic_in_inheading2(self): |
| 38 | + toc = self.init_update(self.bracket_text)['toc'] |
| 39 | + self.assert_In('- [_this is italic_](#this-is-italic-1)', toc) |
| 40 | + |
| 41 | + def test_italic_in_inheading3(self): |
| 42 | + toc = self.init_update(self.bracket_text)['toc'] |
| 43 | + self.assert_In('- [_this is not italic __](#_this-is-not-italic-__)', toc) |
| 44 | + |
| 45 | + def test_italic_in_inheading4(self): |
| 46 | + toc = self.init_update(self.bracket_text)['toc'] |
| 47 | + self.assert_In('- [this _is italic_](#this-is-italic-2)', toc) |
| 48 | + |
| 49 | + def test_italic_in_inheading5(self): |
| 50 | + toc = self.init_update(self.bracket_text)['toc'] |
| 51 | + self.assert_In('- [_ this is not italic _](#_-this-is-not-italic-_)', toc) |
| 52 | + |
| 53 | + def test_italic_in_inheading6(self): |
| 54 | + toc = self.init_update(self.bracket_text)['toc'] |
| 55 | + self.assert_In('- [2 _ this is not italic _](#2-_-this-is-not-italic-_)', toc) |
| 56 | + |
| 57 | + def test_italic_in_inheading7(self): |
| 58 | + toc = self.init_update(self.bracket_text)['toc'] |
| 59 | + self.assert_In('- [_this is not italic with markdown error _](#_this-is-not-italic-with-markdown-error-_)', toc) |
| 60 | + |
| 61 | + def test_italic_in_inheading8(self): |
| 62 | + toc = self.init_update(self.bracket_text)['toc'] |
| 63 | + self.assert_In('- [2 _this is not italic with markdown error _](#2-_this-is-not-italic-with-markdown-error-_)', toc) |
| 64 | + |
| 65 | + def test_italic_in_inheading9(self): |
| 66 | + toc = self.init_update(self.bracket_text)['toc'] |
| 67 | + self.assert_In('- [`_should ignore underscores in codeblocks_`](#_should-ignore-underscores-in-codeblocks_)', toc) |
| 68 | + |
| 69 | + def test_italic_in_inheading10(self): |
| 70 | + toc = self.init_update(self.bracket_text)['toc'] |
| 71 | + self.assert_In('- [`_should ignore underscores in codeblocks 2_ `](#_should-ignore-underscores-in-codeblocks-2_-)', toc) |
| 72 | + |
| 73 | + def test_italic_in_inheading11(self): |
| 74 | + toc = self.init_update(self.bracket_text)['toc'] |
| 75 | + self.assert_In('- [this is ` _more complex_ ` exmaple](#this-is-_more-complex_-exmaple)', toc) |
0 commit comments