Python script to convert a Markdown file to M