mirror of
https://github.com/Hopiu/django-markdownx.git
synced 2026-05-15 16:23:09 +00:00
Merge pull request #19 from aaugustin/master
Make rendering the markdown actually abstractable.
This commit is contained in:
commit
34e284bb60
1 changed files with 4 additions and 2 deletions
|
|
@ -1,13 +1,15 @@
|
|||
from django.views.generic.edit import View, FormView
|
||||
from django.conf import settings
|
||||
from django.http import HttpResponse, JsonResponse
|
||||
from django.utils.module_loading import import_string
|
||||
from django.views.generic.edit import View, FormView
|
||||
|
||||
from .forms import ImageForm
|
||||
from .utils import markdownify
|
||||
|
||||
|
||||
class MarkdownifyView(View):
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
markdownify = import_string(settings.MARKDOWNX_MARKDOWNIFY_FUNCTION)
|
||||
return HttpResponse(markdownify(request.POST['content']))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue