added 'plain' parameter to output plain text without markup