SWC-372: improve markdown performance (cut time in half) but maintain functionality.