[Pushed] Extra </li> in lists output by the parser
#1
It seems that the parser is outputting an extra </li> before the first element of a list.

Here's a suggested patch to fix the issue -  I haven't filed it as a PR because I understand that protocol is to report bugs here first.

In inc/class_parser.php, in function mycode_parse_list(), replace:

 		$message = preg_replace("#[^\S\n\r]*\[\*\]\s*#", "</li>\n<li>", $message);
		$message .= "</li>";


with:

		$a = preg_split("#[^\S\n\r]*\[\*\]\s*#", $message);
		if(isset($a[0]) && trim($a[0]) == '')
		{
			array_shift($a);
		}
		$message = '<li>'.implode("</li>\n<li>", $a)."</li>\n";
Reply
#2
I can confirm the issue.
Though there is no visual impact but looking at the output source its evident.
Reply
#3
Good catch, I never noticed this before. I'm pushing this to GitHub now.
Reply
#4
Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/3128

Thanks for contributing to MyBB!

Regards,
The MyBB Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)