Generates an anchor for a markdown header.