small efficiency fix for markdown headings