Improve Markdown helper functions