Empty ordered lists cause a crash

When formatting ordered lists the code tries to query `elem.children.length` before checking to make sure that `elem.children` exists, which it doesn't if there are none present.

This fixes that.  I tried to keep the formatting and comment style consistent.

Avi