diff --git a/progit/__init__.py b/progit/__init__.py index 4958bfe..47b9f26 100644 --- a/progit/__init__.py +++ b/progit/__init__.py @@ -33,6 +33,7 @@ import progit.lib import progit.mail_logging import progit.doc_utils import progit.login_forms +import markdown # Create the application. @@ -348,6 +349,17 @@ def shorted_commit(cid): return cid[:APP.config['SHORT_LENGTH']] +@APP.template_filter('markdown') +def markdown_filter(text): + """ Template filter converting a string into html content using the + markdown library. + """ + if text: + return markdown.markdown(text) + + return '' + + @FAS.postlogin def set_user(return_url): ''' After login method. ''' diff --git a/progit/templates/issue.html b/progit/templates/issue.html index 76d2e69..593f2df 100644 --- a/progit/templates/issue.html +++ b/progit/templates/issue.html @@ -36,7 +36,7 @@ {% autoescape false %} - {{ issue.content | rst2html }} + {{ issue.content | markdown }} {% endautoescape %}

@@ -55,7 +55,7 @@ {% for comment in issue.comments %} {% autoescape false %} - {{ comment.comment | rst2html }} + {{ comment.comment | markdown }} {% endautoescape %}

{{ comment.user.user | avatar(16) | safe }}