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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user