RichTextCopy function for markdown files