extract markdown, so that it can use other func