corrected how lists are detected within the document