dcwatson / bbcode

A pure python bbcode parser and formatter.
BSD 2-Clause "Simplified" License
68 stars 17 forks source link

Quotation marks in brackes confuses parser #22

Closed angry-elf closed 8 years ago

angry-elf commented 8 years ago

Here are samples:

import bbcode
bbcode.render_html("[b]Hello, [world][/b]")
'<strong>Hello, [world]</strong>'  # all ok

bbcode.render_html("[b]Hello, [wor'ld][/b]")
'<strong>Hello, [wor&#39;ld][/b]</strong>'   # see - [/b] and closing </strong>

bbcode.render_html("[b]Hello, [wor\"ld][/b]")
'<strong>Hello, [wor&quot;ld][/b]</strong>'  # same issue
lampslave commented 8 years ago

Same issue with code tag:

bbcode.render_html('''[code]["'\'']["'\''][/code]''')
'<code>[&quot;&#39;&#39;&#39;][&quot;&#39;&#39;&#39;][/code]</code>'
dcwatson commented 8 years ago

I also pushed out a new version (1.0.22) to PyPI.

lampslave commented 8 years ago

Thanks a lot!