Set correct filetype when writing Markdown files