BUG: valid bbcode syntax breaks first list item

This is valid bbcode:

    Here's text.
    [ol][li]this breaks it.[/li]
    [li] this will be labelled number 1.[/li]
    [/ol]