Plain text and intelligent text options for comment text added to preserve basic text structure and to make links clickable.

svn path=/plone.app.discussion/trunk/; revision=38931
This commit is contained in:
Timo Stollenwerk
2010-08-25 14:03:29 +00:00
parent 35d7743b7a
commit a2c89ed5e8
6 changed files with 56 additions and 12 deletions
+4 -1
View File
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from Acquisition import aq_inner
from AccessControl import getSecurityManager
@@ -213,7 +214,9 @@ class CommentsViewlet(ViewletBase):
def cook(self, text):
transforms = getToolByName(self, 'portal_transforms')
targetMimetype = 'text/html'
mimetype = 'text/plain'
registry = queryUtility(IRegistry)
settings = registry.forInterface(IDiscussionSettings)
mimetype = settings.text_transform
return transforms.convertTo(targetMimetype,
text,
context=self,