Closed jdarwood007 closed 7 years ago
Result:
<ul class="bbc_list"><li>Test</li></ul>[li]More[/li][/list]<div class="codeheader">Code: <a href="javascript:void(0);" onclick="return smfSelectText(this);" class="codeoperation">[Select]</a></div><code class="bbc_code">Some COde</code><ul class="bbc_list">[/li]</ul>
It happens in the preparser. This is the result:
[list][li]Test[/li][/list][li]More[/li][/list][code]Some COde[/code][list][/li][/list]
I think it would require completely changing the preparser. It happens because the regex that checks if the lists/tables are closed are done on each element of an array. That array is created by preg_split('~(\[/code\]|\[code(?:=[^\]]+)?\])~i'
which splits the message by code blocks. It will also break tables with code blocks inside of it as well for the same reason.
Or we could just declare that code blocks do not belong inside lists or tables...
In all honesty, I don't think that they do...
I agreed FWIW, code should exist only outside of tables and lists. The parser should just ignore it. (or not parse it as anything other than plain text)
By golly, I think I've fixed this one. :) #3572
The above BBC breaks and does not product a proper output and the parser incorrectly handles ending the list. The code bbc is very special so it could be difficult to handle properly. The quote bbc works fine though.