fix markdown file extension check bugs