fixed buffer issues in markdown class