resolves #967 - toc doesn't display nested elements correctly

 - Modified html5.rb to check whether there is a child toc before outputting closing </li> on parent toc element