From 87700f381031cb26fe8306cf057dbc14529d0dbe Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 5 Aug 2011 10:08:39 +0000 Subject: [PATCH] Markdown syntax added to possible comment text transforms. svn path=/plone.app.discussion/trunk/; revision=51530 --- CHANGES.txt | 3 +++ plone/app/discussion/browser/comments.py | 9 +++++++++ plone/app/discussion/vocabularies.py | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 01ae0cb..6cef87f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,9 @@ Changelog 2.1.0 (unreleased) ------------------ +- New feature: Markdown syntax added to possible comment text transforms. + [timo] + - Make sure the comment brains are updated properly when the content object is renamed. [hannosch, timo] diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index 159d3af..dc86eee 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -49,6 +49,12 @@ COMMENT_DESCRIPTION_PLAIN_TEXT = _( default=u"You can add a comment by filling out the form below. " + "Plain text formatting.") +COMMENT_DESCRIPTION_MARKDOWN = _( + u"comment_description_markdown", + default=u"You can add a comment by filling out the form below. " + + "Plain text formatting. You can use the Markdown syntax for " + + "links and images.") + COMMENT_DESCRIPTION_INTELLIGENT_TEXT = _( u"comment_description_intelligent_text", default=u"You can add a comment by filling out the form below. " + @@ -293,6 +299,9 @@ class CommentsViewlet(ViewletBase): if settings.text_transform == "text/x-web-intelligent": message = translate(Message(COMMENT_DESCRIPTION_INTELLIGENT_TEXT), context=self.request) + elif settings.text_transform == "text/x-web-markdown": + message = translate(Message(COMMENT_DESCRIPTION_MARKDOWN), + context=self.request) else: message = translate(Message(COMMENT_DESCRIPTION_PLAIN_TEXT), context=self.request) diff --git a/plone/app/discussion/vocabularies.py b/plone/app/discussion/vocabularies.py index ab63e12..86de997 100644 --- a/plone/app/discussion/vocabularies.py +++ b/plone/app/discussion/vocabularies.py @@ -81,6 +81,11 @@ def text_transform_vocabulary(context): value='text/plain', token='text/plain', title='Plain text')) + terms.append( + SimpleTerm( + value='text/x-web-markdown', + token='text/x-web-markdown', + title='Markdown')) terms.append( SimpleTerm( value='text/x-web-intelligent',