Trim markdown output in controller