MyBB Community Forums

Full Version: My nested lists don't work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I've just installed MyBB v1.6.13, and can't use nested lists : when ending the nested list, it ends also the main list, and any further info or item is displayed outside. It looks to me like a major bug, but there is surely a solution, a simple workaround.

Here is the code
[list]
[*]First list, first item
[*]First list, second item
[list=1]
[*]Item 1
[*]Item 2
[/list]
This is a part of the second item of the first, unordered list, but is displayed outside any list
[*]First list, third item
[/list]

Here is the generated HTML
<ul>
<li>First list, first item</li>
<li>First list, second item<br>
<ol type="1">
<li>Item 1</li>
<li>Item 2<br>
</li></ol></li></ul>
This is a part of the second item of the first, unordered list, but is displayed outside of any list
<li>First list, third item, also displayed outside<br>

Here is the rendering
  • First list, first item
  • First list, second item
    1. Item 1
    2. Item 2
    This is a part of the second item of the first, unordered list, but is displayed outside any list
  • First list, third item

Nested lists are essential to many presentations, summaries, articles, it's an important part of HTML features, so I think there must be already a solution for that in MyBB.

But I didn't find answers on this board (with "nested lists"), that's why I start this topic.

Hope some here have the knowledge. Thanks in advance



OK, I googled the web with "mybb nested lists" and found this topic, where all is already explained :
From Zash: Nesting List Elements Bug Test (2008)

Hey, it was in 2010, I even see messages there from 2008. Do I dream or we are in 2014 ?

Help needed ? I'm ok to participate



In fact, it is simple to get nice nested lists, one have only to get rid of too systematic PHP habits with regular expression. Functions like "preg_replace" or "preg_replace_callback", and I think regular expressions in general don't fit our needs when dealing with nested contents.

One have to get acquainted again with lower level coding, a little bit algorithm... OK, I need 100 code lines to replace the 40 previous ones and to get this, but it worth it : the result is here, and execution is faster ! Here is a simple copy of what MyBB can do.

BTW : a proof that MyBB is not too bad written, I have immediately found where and what to do, and it's rather clean.
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/602

Thanks for contributing to MyBB!

Regards,
The MyBB Group