Use the cleaned_markdown_conversion method instead of doing that manually
This commit is contained in:
parent
216cd9c85c
commit
95e6da024d
@ -16,8 +16,8 @@
|
||||
|
||||
from webob import exc
|
||||
from mediagoblin.db.util import DESCENDING, ObjectId
|
||||
from mediagoblin.util import Pagination, render_to_response, redirect, \
|
||||
clean_html
|
||||
from mediagoblin.util import (
|
||||
Pagination, render_to_response, redirect, cleaned_markdown_conversion)
|
||||
from mediagoblin.user_pages import forms as user_forms
|
||||
|
||||
from mediagoblin.decorators import uses_pagination, get_user_media_entry, \
|
||||
@ -25,7 +25,6 @@ from mediagoblin.decorators import uses_pagination, get_user_media_entry, \
|
||||
|
||||
from werkzeug.contrib.atom import AtomFeed
|
||||
|
||||
import markdown
|
||||
|
||||
@uses_pagination
|
||||
def user_home(request, page):
|
||||
@ -101,6 +100,7 @@ def media_home(request, media, **kwargs):
|
||||
'pagination': pagination,
|
||||
'comment_form': comment_form})
|
||||
|
||||
|
||||
@require_active_login
|
||||
def media_post_comment(request):
|
||||
"""
|
||||
@ -111,11 +111,7 @@ def media_post_comment(request):
|
||||
comment['author'] = request.user['_id']
|
||||
comment['content'] = request.POST['comment']
|
||||
|
||||
md = markdown.Markdown(
|
||||
safe_mode = 'escape')
|
||||
comment['content_html'] = clean_html(
|
||||
md.convert(
|
||||
comment['content']))
|
||||
comment['content_html'] = cleaned_markdown_conversion(comment['content'])
|
||||
|
||||
comment.save()
|
||||
|
||||
@ -123,6 +119,7 @@ def media_post_comment(request):
|
||||
media = request.matchdict['media'],
|
||||
user = request.matchdict['user'])
|
||||
|
||||
|
||||
ATOM_DEFAULT_NR_OF_UPDATED_ITEMS = 5
|
||||
|
||||
def atom_feed(request):
|
||||
|
Loading…
x
Reference in New Issue
Block a user