File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -138,6 +138,16 @@ def test_github_issue_45():
138138 expect = '\t <p><a href="https://myabstractwiki.ru/index.php/%D0%97%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0">test</a></p>'
139139 assert result == expect
140140
141+ def test_github_issue_46 ():
142+ """Key error on mal-formed numbered lists. CAUTION: both the input and the
143+ ouput are ugly."""
144+ text = '# test\n ### test\n ## test'
145+ expect = ('\t <ol>\n \t \t <li>test\n \t \t \t <ol>\n \t \t \t \t <li>test</li>'
146+ '\n \t \t \t </ol></li>\n \t \t <ol>\n \t \t \t <li>test</li>'
147+ '\n \t \t </ol></li>\n \t \t </ol>' )
148+ result = textile .textile (text )
149+ assert result == expect
150+
141151def test_github_issue_47 ():
142152 """Incorrect wrap pre-formatted value"""
143153 text = '''pre.. word
Original file line number Diff line number Diff line change @@ -348,7 +348,10 @@ def fTextileList(self, match):
348348 # This will only increment the count for list items, not
349349 # definition items
350350 if showitem :
351- self .olstarts [tl ] = self .olstarts [tl ] + 1
351+ try :
352+ self .olstarts [tl ] = self .olstarts [tl ] + 1
353+ except KeyError :
354+ self .olstarts [tl ] = 1
352355
353356 nm = re .match ("^(?P<nextlistitem>[#\*;:]+)(_|[\d]+)?{0}"
354357 "[ .].*" .format (cls_re_s ), nextline )
You can’t perform that action at this time.
0 commit comments