>>Maybe you could add other tag after the ul to set that margin-bottom or even apply this style to only the last li item.
It is not feasible to add a style to the last listitem. We have ~31,000 rows of data, with several hundred <ul>s and <ol>s.
I did find another workaround. I added this to the default section of the switch statement in closePreviousTags():
if ($tag == 'ul' || $tag == 'ol') {
self::$openBr++;
}
It works OK. Not the best, but it will do..