Fix double-spaced task lists

Task lists which had one or more spaces between their elements were not rendering correctly because the markdown filter was translating this into a <p> tag inside the task <li>, which our task list filter was not expecting.

Update the task list filter to handle this case.