Improve markdown handling