pirave / postmarkup

Automatically exported from code.google.com/p/postmarkup
0 stars 0 forks source link

AssertionError in render_bbcode('[center][img]url[/center]') #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
from postmarkup import render_bbcode
print render_bbcode('[center][img]url[/center]')

Traceback (most recent call last):
  File "D:\test_pm.py", line 2, in <module>
    print render_bbcode('[center][img]url[/center]')
  File "D:\postmarkup.py", line 1214, in render_bbcode
    tag_data=tag_data)
  File "D:\postmarkup.py", line 1170, in render_to_html
    node_text = node_text(i)
  File "D:\postmarkup.py", line 1034, in call
    return tag.render_open(parser, node_index)
  File "D:\postmarkup.py", line 413, in render_open
    self.skip_contents(parser)
  File "D:\postmarkup.py", line 186, in skip_contents
    parser.skip_to_node(self.close_node_index)
  File "D:\postmarkup.py", line 697, in skip_to_node
    assert node_index is not None, "Node index must be non-None"
AssertionError: Node index must be non-None2. 

patch fixes this problem, but breaks one of the tests:
'[b]bold [u]both[/b] underline[/u]' == '<strong>bold <u>both</u></strong> 
underline'
instead
'[b]bold [u]both[/b] underline[/u]' == '<strong>bold <u>both</u></
strong><u> underline</u>'

Original issue reported on code.google.com by ofigetit...@gmail.com on 23 Dec 2009 at 6:39

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks. Fixed in trunk.

Original comment by willmcgugan on 31 Dec 2010 at 11:57