Merge pull request #584 from liangliangyy/dev

markdown 调整
develop
且听风吟 4 years ago committed by GitHub
commit 3951907da4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,7 +3,6 @@ import logging
import random import random
import urllib import urllib
import bleach
from django import template from django import template
from django.conf import settings from django.conf import settings
from django.db.models import Q from django.db.models import Q
@ -45,7 +44,6 @@ def datetimeformat(data):
@register.filter() @register.filter()
@stringfilter @stringfilter
def custom_markdown(content): def custom_markdown(content):
content = bleach.clean(content)
return mark_safe(CommonMarkdown.get_markdown(content)) return mark_safe(CommonMarkdown.get_markdown(content))

@ -60,7 +60,9 @@
<hr class="break_line"/> <hr class="break_line"/>
{% endif %} {% endif %}
<div class="article"> <div class="article">
{{ article.body|custom_markdown|escape }}
{{ article.body|custom_markdown|escape }}
</div> </div>
{% endif %} {% endif %}

Loading…
Cancel
Save