veger / ruby-bbcode

Convert BBCode to HTML and check whether the BBCode is valid
http://rubygems.org/gems/ruby-bbcode
MIT License
28 stars 29 forks source link

Parser fail on bullet list with bold tag inside #30

Closed Migoo closed 7 years ago

Migoo commented 7 years ago

Hi,

We are using your gem to decode some bbcode. We found an issue when we include a bold tag inside a bullet list. here is our bbcode code:

[list]
  [*][b]De délicieuses pâtes et nouilles fraîches:[/b] Préparez 300 g de pâtes ou de nouilles en seulement 10 minutes
  [*][b]Processus automatique: [/b]Une fois que vous avez sélectionné votre programme et appuyé sur le bouton de démarrage, la machine mélange, pétrit et extrude automatiquement.
[/list]

it raise the following error when we call bbcode_to_html [*] can only be used in [list], [ul] and [ol], so using it in a [*] tag is not allowed, Closing tag [/list] doesn't match [*], [list] not closed, [*] not closed, [*] not closed

if we remove the [b] and [/b] tag it works fine. it look like there is an error in the parser `bbcode_to_html'

Any help si welcoming ! Thanks

veger commented 7 years ago

Thanks for the report!

I believe it is fixed now (at least my reproduction test case is)