Divide up literal unit input to apply font and allow breaks

This also fixes some mistakes in the replacement code ordering.