jarrett / rbbcode

Converts BBCode to HTML. Gracefully handles invalid input. Built on Treetop.
41 stars 9 forks source link

List Items not formatted correctly #11

Closed drewreeve closed 11 years ago

drewreeve commented 13 years ago

There seems to be some quirkiness with lists, if I do the following (which is standard bbcode):

str = '[list][*]one [*]two [*]three [/list]'
parser = RbbCode::Parser.new
html = parser.parse(str)

The li elements get munged together and the order is lost:

<ul><li>one <li>three </li></li><li>two </li></ul>

This also happens if the list is formatted like this:

[list]
[*] One
[*] Two
[*] Three
[/list]

However, if an extra line break is added after each list item, then everything is parsed correctly. Everything also works fine if a closing [/*] is added to list item. The problem seems to be in how the tree maker handles tags with closes_twins in the schema, I've yet to figure out how to fix it though.

I'm working around this for now using a different custom tag but it would be terrific if you could take a look at this when you have time. I did attempt to fix it myself but I didn't have much luck.

Thanks

jarrett commented 11 years ago

A new version based on Treetop will be coming out soon. This is a total rewrite, so all current issues will be closed.