Hi everyone I have a very simple bbcode parsing system, it currently has problems with lists in lists.
My code is:
$find = array( '/\[list\](.*?)\[\/list\]/is', '/\[\*\](.*?)(\n|\r\n?)/is', '/\[ul\](.*?)\[\/ul\]/is', '/\[li\](.*?)\[\/li\]/is' ); $replace = array( '<ul>$1</ul>', '<li>$1</li>', '<ul>$1</ul>', '<li>$1</li>' ); $body = preg_replace($find, $replace, $body);
The problem is that you have another list inside the li tags, after which it is not completely parsed, the screenshot shows: 
Here's how it should look: 
I know that my code is probably too simple for him, but how to configure it so that it can parse a list in a list item?
source share