add support for markdown filetype

closes #1
refactor to remove duplication