Markdown: fix end-of-section detection. fixes #268