Rich text comments?

Is there anyone who has tackled extending to support rich text display, transformation, and editing using pat-tinymce? I am looking for ideas/tips.

I want to support this for an add-on I will be working on, which initiallly is going to leverage plain-text discusssion, but will need to eventually support:

  • Limited (safe) rich text comments;
  • Upload of images and/or file attachments from comments.
  • Use of rich text comments only where explicitly configured.

My assumption is that I extend IComment to change the text field type, and change the mime_type value to 'text/html' for comments. I am not sure what this breaks,

Any direction is appreciated.


Clearly the sort of thing you'd want only trusted users to do... Limits on size?

When we enhanced the commenting system for, we used markdown to allow the users to create "rich-text" comments. HTML comments and a TinyMCE widget are possible (I think we even implemented that as well). Though, HTML comments are harder to keep safe of course.

You might want to look into:

If I recall correctly, we worked on file upload for comments.

You don't need to extend IComment. I think you can just use portal transforms and use a custom transform. To add additional fields for file upload you can extend the comment form:

Feel free to ping me if you run into problems. I'd be interested in any enhancements of It has been a while since I touched the code though. :slight_smile:

1 Like