2009-03-09 13:47:21 -04:00
|
|
|
"""
|
|
|
|
views for django-markitup
|
|
|
|
|
2009-03-18 12:40:42 -04:00
|
|
|
Time-stamp: <2009-03-18 11:24:32 carljm views.py>
|
2009-03-09 13:47:21 -04:00
|
|
|
|
|
|
|
"""
|
|
|
|
from django.template.context import RequestContext
|
|
|
|
from django.shortcuts import render_to_response
|
|
|
|
|
2009-03-18 12:40:42 -04:00
|
|
|
from markitup.markup import filter_func
|
2011-11-08 09:10:14 +05:30
|
|
|
from django.views.decorators.csrf import csrf_exempt
|
2009-03-18 12:40:42 -04:00
|
|
|
|
2011-11-08 09:10:14 +05:30
|
|
|
@csrf_exempt
|
2009-03-18 12:40:42 -04:00
|
|
|
def apply_filter(request):
|
|
|
|
markup = filter_func(request.POST.get('data', ''))
|
2009-03-09 13:47:21 -04:00
|
|
|
return render_to_response( 'markitup/preview.html',
|
|
|
|
{'preview':markup},
|
|
|
|
context_instance=RequestContext(request))
|