added switch for html/plain for editor