Fix detection of ordered list to trim text before checking with regex.

This fixes some ordered lists to be incorrectly recognized as unordered
lists due to trailing whitespace.