BBCode such as [b][*]foo[/b] will currently render as <strong><li>foo</li></strong> which is invalid HTML as li elements are not permitted as children of strong tags, spec here. Depending on the parser, this can cause a phony list element to be inserted before and as parent to the first errant li tag, swallowing the remainder of the document (observed in chrome) or simply fail to parse.
This PR changes this behavior so that * tags which are not the immediate child of a list tag will not be rendered as HTML.
BBCode such as
[b][*]foo[/b]
will currently render as<strong><li>foo</li></strong>
which is invalid HTML asli
elements are not permitted as children ofstrong
tags, spec here. Depending on the parser, this can cause a phony list element to be inserted before and as parent to the first errantli
tag, swallowing the remainder of the document (observed in chrome) or simply fail to parse.This PR changes this behavior so that
*
tags which are not the immediate child of alist
tag will not be rendered as HTML.