I have a list of li elements with classes representing their type (ordered or unordered) and their list level (2 is a sublist, 3 is a sublist of a sublist etc.)
I need to wrap them up in the / tags correctly but I haven't figured out how yet.
Example:
<li class="ordered O1">
<li class="ordered O1">
<li class="unordered O2">
<li class="ordered O1">
Should be:
<ol>
<li class="ordered O1">
<li class="ordered O1">
<ul>
<li class="unordered O2">
</ul>
<li class="ordered O1">
</ol>