Coverage for markupmirror.views: 92%

# Coverage for markupmirror.views : 92%

## 13 statements 12 run 1 missing 0 excluded

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | from django.http import HttpResponse from django.views.generic.base import View from markupmirror.markup.base import markup_pool class MarkupPreview(View): """Renders markup content to HTML for preview purposes.""" http_method_names = ['post'] def post(self, request, *args, **kwargs): markup_type = self.request.POST.get('markup_type') if not markup_type: return HttpResponse(u"", content_type='text/html') markup = markup_pool.get_markup(markup_type) text = self.request.POST.get('text', u"") return HttpResponse(markup(text), content_type='text/html') __all__ = ('MarkupMirrorPreview',)