@ajax_required
def preview_content(request):
 if ('text' not in request.POST):
  return JsonResponseBadRequest({'msg': _('Text is missing')})
 return JsonResponse({'rendered': apply_markup_filter(request.POST['text'])})

@ ajax_required def preview_content ( request ) : if ( 'text' not in request . POST ) : return JsonResponseBadRequest ( { 'msg' : _ ( 'Text is missing' ) } ) return JsonResponse ( { 'rendered' : apply_markup_filter ( request . POST [ 'text' ] ) } )
returns content rendered based on the configured markup settings .