improve markdown and folding support