Skip to content
Snippets Groups Projects
Commit f4bebfda authored by Chris Lawton's avatar Chris Lawton
Browse files

add tomd and convert comment html to markdown

parent b5d07231
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,7 @@
updated <a href="{{ activity.submission.get_absolute_url }}">{{ activity.submission.title }}</a>
{% endif %}
<div class="feed__comment js-comment" data-id="{{activity.id}}" data-comment="{{activity.message}}">
<div class="feed__comment js-comment" data-id="{{activity.id}}" data-comment="{{activity.message|to_markdown}}">
{{ activity|display_for:request.user|submission_links|markdown|bleach }}
</div>
......
import mistune
import tomd
from django import template
register = template.Library()
mistune_markdown = mistune.Markdown()
@register.filter
def markdown(value):
markdown = mistune.Markdown()
return markdown(value)
return mistune_markdown(value)
@register.filter
def to_markdown(value):
return tomd.convert(value)
......@@ -43,6 +43,7 @@ mistune==0.8.4
Pillow==4.3.0
psycopg2==2.7.3.1
social_auth_app_django==3.1.0
tomd==0.1.3
wagtail~=2.2.0
wagtail-cache==0.5.1
whitenoise==4.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment