Markdown behaviour refactor