Fork from https://bitbucket.org/npaul/mdreader